Mermaid Syntax Error in text on mdbook highlight #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mermaid diagram is failing on mdbook search.
How to reproduce:
Search anything on mdbook that matches the texts inside mermaid diagram. It fails with said message.
Possible keyword clashes between query param
highlightHighlighting is done client-side in JS. It inserts some additional HTML around the words to highlight.
The mermaid code is still in the HTML and the highlighter runs before mermaid.js.
There's really not much we can do here.
@badboy any way to avoid it ? Like disable highlight in mermaid?
The highlighting is done in mdbook's JavaScript here:
rust-lang/mdBook@bd323fb930/src/theme/searcher/searcher.js (L298-L315)I don't know how it works. Maybe
mark_excludecan be a list of things?It's always set to the empty list though, so you would either need to modify that file and deploy it or find a way to inject your own configuration before it runs.
Alternatively figure out a way for mermaid.js to run before the searcher.js does its job.
One way to do this is pulling mermaid.js to the server side.
Not in the scope of this project, but running chrome works quite nicely.
http://github.com/Commanderstorm/mdbook-mermaid-ssr