Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-127

An included block is never moved, cut, copied, selected or pasted after

When a move, a copy, a cut, a block selection or a paste would involve a block that comes from an {include}, the extension SHALL refuse it, the page by disabling the arrow, ending or emptying the selection or showing a notice and the host by answering with the reason of that case, and change nothing.

Another outcome at step 1 of path 1 in StRS-MDOKFSTUDIO-BLOCK-014, in the state “Edit mode is on”.

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

Another outcome at step 1 of path 1 in StRS-MDOKFSTUDIO-BLOCK-016, in the state “Edit mode is on and no editor is open”.

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

Scenarios 9

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

nominalBlocks without an include
InputOutcome
A block that opens another directive, the move is plannedIt is planned
A document without includes, the bars are builtNo arrow is disabled except at the ends
A span without an include, a copy is handledIt is done
The focused insert point of a normal block, the writer presses Ctrl+VpreviewBlocksPaste is posted
A paste after line 0 or after a line outside the textThe include check does not refuse
refusalThe host refuses to move an included block
Givena block whose first line opens an {include} fence (colon, backtick or tilde fence)
Whenthe move is planned
Thenit is refused with "A block that comes from an included file cannot be moved." and nothing changes
refusalThe arrows beside an included block are disabled
Givena block that comes from an include, with a normal block above it
Whenthe bars are built
Thenboth arrows of the included block's bar are disabled, and the down arrow of the block above is disabled as well
boundaryA selection never reaches an included block
InputOutcome
Blocks A, B, included C and D, A is the anchor, the writer Shift+clicks DA and B are selected, not C or D
An included block directly after the anchor A, the writer Shift+clicks itOnly A is selected
An included block clicked first, the writer Shift+clicks another blockNothing is selected
A focused included block, the writer presses Shift+ArrowDownNothing is selected
refusalCopy and cut of an included block
Givena span that contains an include directive line
Whenthe copy or the cut is handled
Thenthe answer is ok false with "A block that comes from an included file cannot be copied or cut." and the clipboard is untouched
refusalThe host refuses to delete an included block
Givena span whose first line opens an {include} fence, or the Delete block button of an included block
Whenthe delete is handled
Thenthe host answers ok false with "A block that comes from an included file cannot be deleted.", nothing changes, and the bar of an included block has no Delete block button
refusalThe page refuses a paste from the insert point of an included block
Giventhe focused insert point of an included block and no selection
Whenthe writer presses Ctrl+V
Thenthe selection status shows "Text cannot be pasted next to a block that comes from an included file." for four seconds and no previewBlocksPaste is posted
refusalThe host refuses a paste after a line that opens an include directive
Givena document whose first block is a fenced {include} directive and a paste after line 1
Whenthe host handles it
Thenthe answer is ok false with "Text cannot be pasted next to a block that comes from an included file." and the document and the clipboard are untouched
refusalThe host refuses a paste after the closing fence of an include directive
Givena document whose first block is a fenced {include} directive of two lines and a paste after line 2, the closing fence, which is where the insert point of the included block sits
Whenthe host handles it
Thenthe answer is ok false with "Text cannot be pasted next to a block that comes from an included file." and the document and the clipboard are untouched; a paste after the blank line that follows the directive is accepted

Implemented in 5

Tested by 9