Behaviour SwRS-MDOKFSTUDIO-PALETTE-232
A slash opens the slash menu only where a command is meant
When the writer types a slash with no selection at the start of a line or after whitespace in the text box of a paragraph editor, an insertion editor, a Start writing editor or a table cell editor, outside inline code and fenced code and not by a paste or an IME composition, the extension SHALL open the slash menu, and close it when a composition starts or when the typed command holds a space or a second slash, leaving the text as typed.
Step 1 of path 1 in StRS-MDOKFSTUDIO-PALETTE-015: from “A block text box is open in edit mode” to “The slash menu lists the commands of the mode”.
Scenarios 6
The situations the tests check; open one to read it.
nominalLine start or after whitespace
Givena block editor with an empty text box
Whenthe writer types /
Thenthe slash menu opens
| Editor | Outcome |
|---|---|
| paragraph editor, insertion editor, Start writing editor, table cell editor | the menu opens for a slash at the start of a line or after whitespace |
refusalA slash inside a word, an address or a tag
Giventhe text path, http: or <
Whenthe writer types /
Thenno menu opens
| Character before the slash | Outcome |
|---|---|
| not whitespace (a path, a scheme, a closing tag) | no menu opens |
| start of the line, or whitespace | the menu may open |
refusalA selection, a paste or an IME composition
Givena selection of text, a text box that receives a slash by paste, and an IME composition that produces a slash
Whenthe input event arrives
Thenno menu opens
| Input | Outcome |
|---|---|
| slash typed while text is selected | no menu opens |
| slash that arrives by a paste | no menu opens |
| slash that arrives during an IME composition | no menu opens |
| input type insertText, or no input type | may open the menu; no other input type does |
boundaryCode
Giventhe caret in or around a code span, a fenced block or a fence line
Whenthe writer types /
Thenthe menu opens or not as the table says
| Caret | Outcome |
|---|---|
| inside a closed inline code span | no menu opens |
| after a closed code span | the menu opens |
| after an unmatched backtick | the menu opens |
| inside a fenced code block | no menu opens |
| after the opening fence, on its info string | no menu opens |
nominalA composition that starts while the menu is open closes it
Givenan open menu
Whena composition starts
Thenthe menu closes
| Event on an open menu | Outcome |
|---|---|
| composition starts | the menu closes |
| the writer types a letter (no composition) | the menu stays open |
boundaryA second slash or a space ends the command
Givenan open menu
Whenthe writer types a second /, or a space
Thenthe menu closes and the typed text stays
| Typed after the slash | Outcome |
|---|---|
| a second slash | the menu closes and // stays plain text |
| a space (any whitespace character counts as a space) | the menu closes and the slash and the space stay |