Walk markdown line-by-line and extract every ```mermaid block.
markdown
```mermaid
Recognition rules (matching the renderer + article-validator):
/^```mermaid[\t ]*$/
/^```[\t ]*$/
```
Pure function โ never mutates markdown or any global state.
Walk
markdownline-by-line and extract every```mermaidblock.Recognition rules (matching the renderer + article-validator):
/^```mermaid[\t ]*$//^```[\t ]*$/```line (e.g. another language tag) is treated as an implicit close and the current block is reported as unclosed.Pure function โ never mutates
markdownor any global state.