Markdown OKF-Schema Studio

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
EditorOutcome
paragraph editor, insertion editor, Start writing editor, table cell editorthe 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 slashOutcome
not whitespace (a path, a scheme, a closing tag)no menu opens
start of the line, or whitespacethe 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
InputOutcome
slash typed while text is selectedno menu opens
slash that arrives by a pasteno menu opens
slash that arrives during an IME compositionno menu opens
input type insertText, or no input typemay 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
CaretOutcome
inside a closed inline code spanno menu opens
after a closed code spanthe menu opens
after an unmatched backtickthe menu opens
inside a fenced code blockno menu opens
after the opening fence, on its info stringno 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 menuOutcome
composition startsthe 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 slashOutcome
a second slashthe 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

Implemented in 2

Tested by 2