Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-160

The TODO action wraps or unwraps the touched lines in TODO comments

When a writer runs the TODO action in a block editor on lines that are not wrapped, the page SHALL wrap each non-blank line touched by the caret or the selection in a TODO comment, after its indentation, and unwrap them when every non-blank touched line is already wrapped.

Step 1 of path 2 in StRS-MDOKFSTUDIO-REVIEW-012: from “A block editor is open on a line” to “The touched lines are wrapped in a TODO comment, or unwrapped”.

Scenarios 8

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

nominalCaret in a line
Giventhe text "abc" with the caret inside
Whenthe TODO action runs
Thenthe line reads "`<!-- TODO: abc -->`" and the caret stays on the same letter
nominalSelection of two lines
Giventhe lines "a" and "b" selected, partly or fully
Whenthe TODO action runs
Thenboth lines are wrapped, each after its own indentation, and the whole block stays selected
nominalUnwrap when every touched line is wrapped
Giventhe lines "`<!-- TODO: a -->`" and "`<!-- TODO: b -->`" selected
Whenthe TODO action runs
Thenthe lines read a and b; and the lines "- one" and "- two" wrapped by the action come back as the original lines when the action runs again (wrap then unwrap restores the text)
boundaryMixed selection and selection ending at a line start
InputOutcome
The lines "a" and "`<!-- TODO: b -->`" selectedBoth lines are wrapped once
A selection that ends at the start of a lineThat last line is left alone
boundaryBlank line
InputOutcome
An empty line with the caretThe line reads "`<!-- TODO: -->`" with the caret between the spaces
A line of two spaces with the caretThe comment keeps the two spaces of indentation
An empty TODO comment with the caret inside itThe comment is removed, the line is empty with the caret
refusalA line holding a comment end is never wrapped
InputOutcome
The line "a --> b" with the caretNo edit is made
The lines "a" and "b --> c" selectedOnly the first line is wrapped
boundaryThe TODO action has no shortcut
InputOutcome
Ctrl+/ or Cmd+/ in the text box of a block editorThe TODO action does not run: the shortcut toggles a plain comment, see SwRS-MDOKFSTUDIO-PALETTE-266
The tooltip of the TODO buttonToggle TODO comment, with no shortcut in parentheses
nominalThe slash menu finds the action by three names
Typed after the slash in a block editorOutcome
/todoThe slash menu lists the TODO action, titled Toggle TODO comment
/fixme or /taskThe slash menu lists the same TODO action

Implemented in 2

Tested by 3