Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-169

Cut removes the selected blocks with one blank separator

When a writer cuts selected blocks, the host SHALL put their Markdown on the clipboard and delete them together with their blank separator in the line breaks of the document, after the range's trailing blank lines (spaces and tabs only) are dropped, so that no gap of two blank lines and no glued blocks are left, and answering that nothing was removed when the document changed during the clipboard write.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-016, in the state “A run of blocks is selected”.

Step 1 of path 2 in StRS-MDOKFSTUDIO-BLOCK-025: from “A run of blocks is selected” to “The blocks are on the clipboard and gone from the document”.

Scenarios 7

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

nominalMiddle block
Givena list between two paragraphs
Whenthe list is cut
Thenthe Markdown of the list is on the clipboard, the list and one blank separator are gone and the paragraphs stay one blank line apart
boundaryWhere the cut span sits in the document
InputOutcome
A span that touches the block above and is followed by a blank lineThe blank line after it stays so that the neighbours remain apart
The first block of a document with three blocksNo blank line starts the body after the cut
The last block of a document with three blocksThe blank line before the last block goes with it
The only block of the bodyThe body is empty
The last block of a document without a final line breakThe document still has no final line break
A list in the middle whose range ends on the two blank lines after itThe clipboard holds the list without the blank lines; the list and the blank lines after it go, and the blocks around it stay one blank line apart, as Delete block leaves them

A cut never leaves three line breaks in a row and never merges two paragraphs.

boundaryLine breaks of what remains
InputOutcome
A document with CR LF line breaks, a block is cutNo bare LF appears in the remaining text
A document with LF line breaks, a block is cutNo CR appears
nominalThe block after a cut keeps its place on the screen
InputOutcome
A cut with pinViewportTop 200 and a block after the spanThe host stores a pin for the first line of the cut span with that viewport top, and the next render puts the line of the span at viewport top 200
A cut of the last block, no block follows the spanNo pin is stored
refusalThe document changed during the clipboard write
InputOutcome
A cut whose clipboard write is pending while the document is editedWhen the write completes, the answer is ok false with "The document changed while cutting. The blocks are on the clipboard, nothing was removed." and the document is unchanged
No change during the writeWhen the write completes, the blocks are removed
nominalA successful cut clears the block selection
Givena block selection and a cut or a paste answered ok true
Whenthe answer arrives
Thenthe page clears the selection and its announcement
refusalA refused cut keeps the block selection
Givena selection and a cut answered ok false
Whenthe answer arrives
Thenthe selection is kept and the reason is shown

Implemented in 4

Tested by 5