Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-266

Cmd or Ctrl with the slash key toggles a plain HTML comment on the touched lines

When the writer presses Cmd+/ or Ctrl+/, with or without Shift, in a block text box, the extension SHALL wrap each non-blank touched line in a plain HTML comment, or unwrap them when every non-blank touched line is already a plain comment, as one undo step.

Part of StRS-MDOKFSTUDIO-PALETTE-019, outside the paths drawn on its map.

Scenarios 4

The situations the tests check; open one to read it.

nominalCaret in a line
Giventhe text "abc" with the caret inside, in a block editor
Whenthe writer presses Ctrl+/ (Cmd+/ on macOS)
Thenthe line reads "`<!-- abc -->`", the caret stays on the same letter, and one undo restores "abc"
nominalSelection of lines, and unwrap
InputOutcome
The lines "a" and "b" selectedBoth lines are wrapped, each after its own indentation
The lines "`<!-- a -->`" and "`<!-- b -->`" selectedThe lines read a and b
The lines "a" and "`<!-- b -->`" selectedThe first line is wrapped and the second stays a single comment
boundaryBlank line and TODO comments
InputOutcome
An empty line with the caretThe line reads "`<!-- -->`" with the caret between the spaces
An empty comment with the caret inside itThe comment is removed
The line "`<!-- TODO: a -->`"No edit is made: the shortcut removes only the plain comments it adds, and the TODO action unwraps TODO comments
refusalKeys and lines that do nothing
InputOutcome
Ctrl+Alt+/ (Alt held)The shortcut is not matched
A line holding "-->" that is not a plain commentThe line is left alone
The shortcut in a table cellNothing happens, see SwRS-MDOKFSTUDIO-TABLE-085

The TODO palette button and the slash menu entry keep inserting `<!-- TODO: … -->` with no shortcut and no shortcut in the tooltip, see SwRS-MDOKFSTUDIO-REVIEW-160. The shortcut has no palette button and no slash menu entry.

Implemented in 3

Tested by 2