Behaviour SwRS-MDOKFSTUDIO-BLOCK-268
Typing or pasting in a blank-line block writes the text in place of that blank line
When the writer types a block in a blank-line block, or pastes in it, the extension SHALL write the text in place of that one blank line and keep the other blank lines, adding a blank line before or after the text only where the neighbouring line exists and is not blank, in one text edit, write nothing for an empty Done, restore the line on Cancel, keep the editor open across an autosave re-render and close it on the render that follows its final save, and refuse a stale line. A text written in place of a blank line inside a list takes the content indent of the item (CommonMark's content column), or the item's own indent when the line is between two items and the first line of the text starts with a list marker; the host checks the item line and refuses it as stale when it is not a list item line. A text written in place of a blank line inside a quote keeps the quote markers of the line, and one inside a directive, a panel, a definition or a footnote takes the indent of that container; the host checks the container line and refuses it as stale when it is not a line of that shape.
Step 2 of path 3 in StRS-MDOKFSTUDIO-BLOCK-011: from “A blank-line block is shown” to “The typed text is in the document where the blank line was”.
Part of StRS-MDOKFSTUDIO-BLOCK-025, outside the paths drawn on its map.
Scenarios 6
The situations the tests check; open one to read it.
nominalTyping writes the text in place of that blank line
nominalA separator only where needed
nominalEmpty Done, Cancel and a paste
nominalDone closes the editor
nominalA block typed inside a list item stays in the item
nominalA stale run
Implemented in 12
- src/core/edits/sourceEdits.ts
- src/core/mapping/blankRunContainer.ts
- src/core/mapping/blockRange.ts
- src/core/mapping/insertion.ts
- src/core/mapping/listItemIndent.ts
- src/core/mapping/quoteLine.ts
- src/core/protocol/pageToHost.ts
- src/page/features/blankLines.ts
- src/page/features/blankRunHosts.ts
- src/page/features/blockSelectionView.ts
- src/page/features/contentPatch.ts
- src/session/features/blockEdits.ts
Tested by 17
- test/core/edits/blankRunContainerWrite.test.tsunit
- test/core/mapping/blankRunContainer.test.tsunit
- test/core/mapping/blankRunInList.test.tsunit
- test/core/mapping/blockRange.test.tsunit
- test/core/mapping/insertion.test.tsunit
- test/core/mapping/listItemIndent.test.tsunit
- test/core/mapping/quoteBlankRuns.test.tsunit
- test/core/protocol/pageToHost.test.tsunit
- test/integration/blankLines.test.tsintegration
- test/page/runtimeBlankLines.test.tsunit
- test/page/runtimeBlankLinesContainers.test.tsunit
- test/session/blankRunHost.test.tsunit
- test/session/blankRunInContainerHost.test.tsunit
- test/session/blankRunInListHost.test.tsunit
- test/visual/blankLinesBlockScenarios.tsvisual
- test/visual/capture_blank_lines_block.pyvisual
- test/visual/capture_blank_lines_containers.pyvisual