Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-124

Moves and clipboard edits are refused for ranges that do not match the document

When the ranges of a block move, the range of a copy or a cut, or the line of a paste do not match the document, or a move or a clipboard edit reaches into the frontmatter, or text lies between the two blocks of a move, the host SHALL answer with the reason of that case and change nothing.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-014, in the state “The host is asked to swap the block with its neighbour”.

Part of StRS-MDOKFSTUDIO-BLOCK-016, outside the paths drawn on its map.

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

Scenarios 6

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

refusalMove ranges that do not match the document
InputOutcome
Two ranges that overlapThe move is refused with "The preview is out of date. Refresh it and try again."
Unordered rangesRefused with the same reason
A range outside the textRefused with the same reason
A range whose first line is blank, or a range of blank lines onlyRefused with the same reason (blank lines at the end of a range are dropped before the check, see SwRS-MDOKFSTUDIO-BLOCK-117)
refusalCopy, cut and paste ranges that do not match the document
InputOutcome
A cut of lines 15 to 99 in a shorter documentThe answer is ok false with "The preview is out of date. Refresh it and try again." and the document is unchanged
A copy or cut range that is out of bounds or unorderedThe same refusal
A copy or cut that starts on a blank line, covers blank lines only, or ends on a line holding only a no-break spaceThe same refusal (spaces-and-tabs lines at the end of a copy or cut range are dropped before the check, see SwRS-MDOKFSTUDIO-BLOCK-166 and SwRS-MDOKFSTUDIO-BLOCK-169)
A paste after a line that does not exist, a line holding only a no-break space, or a blank line with no body line above it (the start of the text, right under the frontmatter)The same refusal (a blank line that ends a block is accepted, see SwRS-MDOKFSTUDIO-BLOCK-174)
refusalMoves into or out of the frontmatter
InputOutcome
A first range inside the frontmatter linesThe move is refused with "A block cannot be moved into or out of the frontmatter."
A move across the frontmatter, also a span next to itRefused with the same reason
refusalCopy, cut and paste in the frontmatter
InputOutcome
A copy of lines 1 to 3 of a document that starts with frontmatterThe answer is ok false with "Blocks of the frontmatter cannot be cut, copied or pasted into."
A cut or a paste that names a line inside the frontmatterThe same refusal
refusalText between the two blocks of a move
Giventwo blocks with an HTML comment between them
Whenthe move is planned
Thenit is refused with "Text between the two blocks (a comment or a link definition) prevents the move." and nothing changes
nominalRanges that match the document
InputOutcome
Two body blocks below the frontmatterThe move is planned normally
Two blocks with only blank lines between themThe move is planned
A copy of body linesThe copy is done

Implemented in 2

Tested by 5