Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-MYST-013

Context tags render as titled panels

When a document holds a lower-case context tag alone on its line with a matching closing tag, the extension SHALL render a no-icon admonition panel titled with the literal tag around the Markdown between the tags, mapped from opening to closing line, nested pairs as nested panels, and keep an unpaired or non-context tag visible as literal text.

Step 1 of path 2 in StRS-MDOKFSTUDIO-MYST-015: from “A document holds a lower-case context tag alone on its line, with its closing tag” to “The context is drawn as a titled panel”.

Scenarios 7

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

nominalStandalone context tags render as titled panels
Givenan opening and a closing context tag named context around links, bold and a fenced YAML block
Whenthe preview renders
Thena panel titled with the tag holds the rendered Markdown and maps to both lines
boundaryOnly the context tag pattern becomes a panel
Givenan inline tag in a sentence
Whenthe preview renders
Thenthe raw tag is not rendered as HTML and no panel is made, since only the pattern `[a-z][a-z0-9_-]*` (lower-case letters, digits, hyphens and underscores) alone on its line with a matching closing tag becomes a panel
nominalNested context tags render as nested panels
Givenan outer tag pair around an inner one
Whenthe preview renders
Thentwo panels are shown, the inner inside the outer, with distinct source ranges, each pair mapping to its own lines
refusalUnpaired tags stay visible as text
Givena context tag with a missing or mismatched closing tag, a tag with attributes, a self-closing tag, or an inner pair with a missing closing tag
Whenthe preview renders
Thenthe tag and its body show as literal text and no panel is made, the unpaired inner tag staying literal text inside the outer panel
refusalNon-context tags are never grouped
Given`div`, `details`, `summary`, `table`, `script`, inline XML or fenced `xml` code, or an upper-case or dotted tag
Whenthe preview renders
Thenthey are never grouped into a panel
nominalContext tags group inside containers and split raw HTML blocks
Givena context tag pair inside a block quote, list item, definition list or directive container, or a raw HTML block kept whole by the parser
Whenthe preview renders
Thenthe pair is grouped as a panel inside its container (for a list item, the panel appears inside the list item) and its Markdown is parsed
boundaryA raw HTML block with tags and Markdown is split
Givena raw HTML block with tags and Markdown without blank lines holding a GitHub alert
Whenthe preview renders
Thenthe block is split and the alert is rendered

Implemented in 1

Tested by 3

Replaces

SwRS-MDOKFSTUDIO-MYST-014Nested context tags render as nested panels superseded superseded by SwRS-MDOKFSTUDIO-MYST-013 Markdown file
SwRS-MDOKFSTUDIO-MYST-015Unpaired or non-context tags stay visible as text superseded superseded by SwRS-MDOKFSTUDIO-MYST-013 Markdown file
SwRS-MDOKFSTUDIO-MYST-016Context tags group inside containers and split raw HTML blocks superseded superseded by SwRS-MDOKFSTUDIO-MYST-013 Markdown file