Skip to content

fix: CommonMark fences and quote-aware component tags (0.1.12-alpha) - #33

Merged
Shewart merged 5 commits into
mainfrom
fix/fence-scanner-inline-attrs
Oct 4, 2026
Merged

Shewart merged 5 commits into
mainfrom
fix/fence-scanner-inline-attrs

Conversation

@Shewart

@Shewart Shewart commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Parser fixes found while rewriting the ShellDocs docs site on 0.1.11, plus the 0.1.12-alpha release prep. Merging this and pushing tag v0.1.12-alpha publishes the release.

Fixed

  • A fence longer than three backticks that showed a shorter fence broke the rest of the page. The next razor:preview rendered as plain code and tags inside the example became empty placeholders. Fences now follow CommonMark: three or more backticks or tildes, closed by a run of the same character at least as long. Empty fences and trailing spaces are handled.
  • A > inside a quoted attribute value ended an inline component tag early, so the component silently disappeared. Inline tags are now read with RazorTagScanner, as razor:preview already was.
  • The same problem in named-slot tags (<Icon title="a > b">), which leaked the rest of the tag into the slot.
  • Code spans in an attribute value could split the value when the span contained a quote.
  • <TypeTable> dropped rows that shared a Name.

Added

  • Tilde fences (~~~), including ~~~razor:preview.

Changed

  • An inline tag with an unterminated quote, or one that spans a blank line, is passed through as raw markup.
  • ShellDocs.Markdown exposes its internals to ShellDocs.Components, so both use the one tag scanner.

Release

  • <Version> is 0.1.12-alpha; the CHANGELOG has the dated section and link; ROADMAP is updated.

Verification

  • Each of the five commits builds and passes on its own; 322 tests at the tip, 16 of them new. The tests for the bugs fail on main.
  • Release build has 0 warnings; the pack dry-run produces the six packages at 0.1.12-alpha; that version is not on nuget.org.
  • A/B render of 320 real pages (ShellUI docs, ShellDocs docs, the example site, ShellIcons docs) on main and on this branch: output is identical for every page, so existing content is unaffected.

After merging

git checkout main && git pull
git tag v0.1.12-alpha
git push origin v0.1.12-alpha

🤖 Generated with Claude Code

TypeTable tracked registered rows by Name, so a second row with the same name (an overload, or two rows describing one thing) was dropped without a warning. Rows are now tracked by their TypeRow component.
The slot extractor only matched three-backtick fences, so a longer fence showing a shorter one was paired with the wrong closing line: the next razor:preview rendered as plain code and tags inside the example became empty placeholders. Fences are now three or more backticks or tildes, closed by a run of the same character at least as long. Empty fences, longer closing fences and trailing spaces are handled.
Inline tags were matched with a regex that ended the tag at the first '>', so a '>' inside a quoted attribute value dropped the component. They now go through RazorTagScanner, as razor:preview does: quoted values can hold '>', another tag, or text that looks like an attribute. Code spans are restored per attribute value, so a quote inside a span can't split it. A tag with an unterminated quote, or one that spans a blank line, is passed through as raw markup.
A child tag routed into a RenderFragment parameter was matched with the same regex as inline tags, so a '>' in one of its attribute values cut the tag short and leaked the rest into the slot. ShellDocs.Markdown now exposes its internals to ShellDocs.Components so SlotRenderer can use RazorTagScanner.
@Shewart
Shewart merged commit b0937db into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant