Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-026

The editor opens with the caret at the clicked word

When a writer clicks rendered text in edit mode, the page SHALL place the caret of the opened text box at the source position of the clicked text, found by matching up to 32 rendered characters on each side of the click, and at the end of the block text without trailing line breaks when no unique place is found.

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

Scenarios 4

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

nominalEmphasis and link markup
Giventhe source `Some **bold** text` and a click after the rendered text `Some bo`
Whenthe editor opens
Thenthe caret sits at `Some **bo|ld** text`; heading marks, list markers, quote prefixes, emphasis marks and link targets are skipped when matching
nominalLink label
Giventhe source `See [the label](https://x.y/z) here` and a click after the rendered text `See the la`
Whenthe editor opens
Thenthe caret sits inside the label at `See [the la|bel](https://x.y/z) here`
boundaryAmbiguous text
Giventhe source `a a a a` and the click context `a a` before and ` a` after
Whenthe editor opens
Thenthe caret sits at the end of the text
boundaryNo caret API
Givena browser without caretRangeFromPoint and caretPositionFromPoint
Whenthe writer clicks a paragraph
Thenthe caret sits at the end of the text

Implemented in 3

Tested by 3