fix: repair the mkdocs block pipeline - #30
Merged
Conversation
Three independent defects made most block-level content render shifted, empty, or not at all: - blockPlaceholder read docBlocks.length after the caller had already pushed, so every placeholder resolved to the following block: the first block on a page was dropped and the last placeholder resolved to nothing. Every prerequisites box on the site fell victim to this. - convertGrid matched the grid body with a lazy regex that stopped at the first nested card's closing div, so grids rendered empty and card content flattened into loose prose (91 grids, 270 cards). - The admonition and collapsible body pattern required consecutive indented lines, but the content puts blank lines inside bodies, so all 13 collapsibles rendered empty and two admonitions truncated; the orphaned body text then rendered as stray code blocks. Also aligned the TOC with the rendered headings (icon shortcodes are now stripped on the TOC path, and heading ids are slugified from entity-decoded text, fixing anchors like #what39s-next), mapped :material-check-circle:/:material-close-circle: to their glyphs instead of deleting them, took only the first info-string token as the code-fence language so 'yaml title=…' highlights as YAML, and generalized collapsibles beyond '??? question'. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The markdown-construct audit found the block machinery broken in three independent ways, live-verified before the fix:
blockPlaceholder()readdocBlocks.lengthafter the caller pushed, so every placeholder resolved to the next block: first block per page dropped, last placeholder empty. (Every prerequisites box site-wide,/smg/referencemissing its first grid,/smg/contributingrendering no cards at all.)</div>— grids rendered empty; card content flattened into loose prose (91 grids / 270 cards site-wide). Replaced with a balanced-depth scan.??? questioncollapsibles empty, orphaned bodies rendering as stray code blocks.Plus TOC alignment (icon stripping + entity-decoded heading ids fix dead anchors like
#what39s-nextand literal:material-*:labels),:material-check/close-circle:→ ✓/✗ instead of deletion, code-fence info-string attributes no longer break highlighting (yaml title=…highlights as YAML), and???/???+variants beyondquestion.Verification (production build, wrangler pages dev)
/smg/reference/smg/contributing/smg/getting-started/tls/smg/concepts/architecture/high-availability/smg/getting-started/logging/smg/concepts/routing/load-balancing:material-*:in TOC, dead anchors#cache-aware/#whats-nextresolveTab-set fix from #27 verified intact (0 literal headings).
pnpm lint/check/buildclean.🤖 Generated with Claude Code