Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-260

A card title or option opens on its own line

When the writer clicks the title of a grid card or of a card in edit mode, or the text of its :header: or :footer: option, the preview SHALL open the block editor on the directive line or on the option line that holds it, and show the title and the option text as inline text so that a leading number stays literal.

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

Scenarios 6

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

nominalThe numbered title of a grid card
Givenedit mode on a document whose line 8 is `:::{grid-item-card} 2. Status projection`
Whenthe writer clicks the title of that card
Thenthe title shows the text "2. Status projection" (the number is not turned into a list), the editor opens inside the card on line 8 and holds that directive line, and Done replaces line 8 only, never line 1 of the document; a plain title such as `Plain *title*` opens its directive line in the same way
nominalThe header and footer options of a card
Givena `{card}` whose options are `:class-card: x` on line 4, `:header: 4. H` on line 5 and `:footer: 5. F` on line 6
Whenthe writer clicks the header text, then the footer text
Thenthe header "4. H" opens the editor on line 5 only and the footer "5. F" on line 6 only, each shown as literal inline text with its number
boundaryA card with a link
Givena `{card}` titled `3. Linked` with the option `:link: https://example.com`, or the grid card `:::{grid-item-card} Linked card` on line 14 with `:link: targets/alpha.md`, a header section, a body on line 19 and a footer on line 21
Whenthe writer clicks the title, the header, the body or the footer in edit mode
Thenthe title is a link mapped to the directive line, like a plain title: a click on it opens the editor on line 3 (line 14 for the grid card) and does not follow the link; a click on the header, the body or the footer opens the editor on that part's own lines, because in edit mode the stretched link of the card no longer covers the card (SwRS-MDOKFSTUDIO-BLOCK-014)
a Cmd or Ctrl click on the title follows the link and opens no editor; in reading mode a click anywhere on the card follows the link
nominalThe one-line card parts are marked
Givena `{card}` with a title, `:header:` and `:footer:` options and a body, and the same card with a `:link:` option
Whenthe renderer maps it and the sanitizer cleans the result
Thenthe title (linked or not), the header text and the footer text carry `data-single-line`, the body does not, and the sanitizer keeps the marker next to `data-line`
boundaryA grid card inside a quote
Givena `{grid}` written inside a quote (`> ::::{grid} 2`) whose body starts with a blank `>` line, then `> :::{grid-item-card} A` and `> Body.`
Whenthe writer clicks the card title or the card body in edit mode
Thenthe editor opens on that card's own directive line or body line, as for the same grid outside a quote, never on the line above
boundaryA grid card inside a list item
Givena `{grid}` opened on a bullet or numbered list item line whose marker is followed by spaces or a tab (`- ::::{grid} 2`, `-<TAB>::::{grid} 2`) and whose body starts with a blank line, then the cards indented to the item's content column with spaces or tabs
Whenthe writer clicks a card title or body in edit mode
Thenthe editor opens on that card's own directive line or body line, as for the same grid outside the list, never on the line above

Implemented in 3

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-BLOCK-258A click on a card title or option opens the editor on its own line, the title is inline text and Enter saves a one-line editor superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-260, SwRS-MDOKFSTUDIO-BLOCK-261 Markdown file