Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-050

Horizontal rule puts three dashes between blank lines

When the writer presses Horizontal rule, the extension SHALL insert --- on its own line, set apart by blank lines, after the line the selection ends on, with the caret after it.

Part of StRS-MDOKFSTUDIO-PALETTE-019, outside the paths drawn on its map.

Scenarios 3

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

nominalAfter a paragraph
Giventhe caret in the text para
WhenHorizontal rule is pressed
Thenthe text becomes para, a blank line, ---, a blank line, with the caret on the last line
nominalEmpty text
Givenan empty text
WhenHorizontal rule is pressed
Thenthe text is --- followed by a blank line
boundaryCaret position and existing blank lines

In this table `[ ]` marks the selection and `|` marks the caret; the rule is written on the line the selection ends on.

InputOutcome
`para|``para`, blank line, `---`, blank line, `|`
`pa|ra``para`, blank line, `---`, blank line, `|`
`a|` newline `b``a`, blank line, `---`, blank line, `|b`
`|``---`, blank line, `|`
`a` newline `|``a`, blank line, `---`, blank line, `|` (no extra blank line)
`a`, blank line, `|``a`, blank line, `---`, blank line, `|` (no extra blank line)
`[a` newline `b]``a` newline `b`, blank line, `---`, blank line, `|`

Implemented in 1

Tested by 1