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
| Input | Outcome |
|---|---|
| The lines "a" and "b" selected | Both lines are wrapped, each after its own indentation |
| The lines "`<!-- a -->`" and "`<!-- b -->`" selected | The lines read a and b |
| The lines "a" and "`<!-- b -->`" selected | The first line is wrapped and the second stays a single comment |
boundaryBlank line and TODO comments
| Input | Outcome |
|---|---|
| An empty line with the caret | The line reads "`<!-- -->`" with the caret between the spaces |
| An empty comment with the caret inside it | The 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
| Input | Outcome |
|---|---|
| Ctrl+Alt+/ (Alt held) | The shortcut is not matched |
| A line holding "-->" that is not a plain comment | The line is left alone |
| The shortcut in a table cell | Nothing 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.