Skip to content

fix(mermaid): emit mermaid diagrams in a raw html block - #14767

Open
mcanouil wants to merge 1 commit into
quarto-dev:mainfrom
mcanouil:fix/issue14765
Open

fix(mermaid): emit mermaid diagrams in a raw html block#14767
mcanouil wants to merge 1 commit into
quarto-dev:mainfrom
mcanouil:fix/issue14765

Conversation

@mcanouil

@mcanouil mcanouil commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #14765.

The mermaid diagram source went into a bare <pre> html block. A lone --- line in it, such as the closing delimiter of mermaid's own front matter, was read as a YAML front matter delimiter. That hid the rest of the document from the cell splitter, so ojs cells after the diagram never ran.

  • Wrap the <pre> in a ```{=html} raw block.
  • Remove the commented-out mermaid tooltip code; mermaid 11.12 creates .mermaidTooltip itself.
  • Add a regression test and a changelog entry.

Output is unchanged: pandoc's reader already made the same RawBlock (Format "html").

A bare `---` line in a mermaid diagram, such as the closing delimiter of
mermaid's own front matter, was read as a YAML front matter delimiter when
quarto split the document into cells. It hid the rest of the document, so
`ojs` cells placed after a mermaid diagram never reached the ojs compiler
and rendered as plain code.

Wrapping the `<pre>` element in a `{=html}` raw block keeps the cell
splitter out of the diagram source. Pandoc's markdown reader already
produced the same `RawBlock (Format "html")` for the bare html block, so
the rendered output does not change.

Also removes the commented-out mermaid tooltip code. Its note said
"removed until we use mermaid 10.0.0"; the bundled runtime is 11.12.0 and
mermaid now creates the `.mermaidTooltip` div itself.
@posit-snyk-bot

posit-snyk-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mcanouil mcanouil changed the title fix: emit mermaid diagrams in a raw html block fix(mermaid): emit mermaid diagrams in a raw html block Aug 12, 2026
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.

Weird Bug: mermaid config option breaks OJS

2 participants