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
| Input | Outcome |
|---|---|
| Two ranges that overlap | The move is refused with "The preview is out of date. Refresh it and try again." |
| Unordered ranges | Refused with the same reason |
| A range outside the text | Refused with the same reason |
| A range whose first line is blank, or a range of blank lines only | Refused 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
| Input | Outcome |
|---|---|
| A cut of lines 15 to 99 in a shorter document | The 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 unordered | The 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 space | The 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
| Input | Outcome |
|---|---|
| A first range inside the frontmatter lines | The 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 it | Refused with the same reason |
refusalCopy, cut and paste in the frontmatter
| Input | Outcome |
|---|---|
| A copy of lines 1 to 3 of a document that starts with frontmatter | The 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 frontmatter | The 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
| Input | Outcome |
|---|---|
| Two body blocks below the frontmatter | The move is planned normally |
| Two blocks with only blank lines between them | The move is planned |
| A copy of body lines | The copy is done |