fix(mermaid): emit mermaid diagrams in a raw html block - #14767
Open
mcanouil wants to merge 1 commit into
Open
Conversation
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.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
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, soojscells after the diagram never ran.<pre>in a```{=html}raw block..mermaidTooltipitself.Output is unchanged: pandoc's reader already made the same
RawBlock (Format "html").