From b987197fb4d0ab9a55c137a0931ddc530d0ac9fa Mon Sep 17 00:00:00 2001 From: Ralf Anton Beier Date: Tue, 12 May 2026 18:00:40 +0200 Subject: [PATCH 1/2] fix(serve): emit fenced ```mermaid bodies verbatim, not HTML-escaped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `render_markdown` injected synthetic `
` wrappers but
still let the fenced body flow through pulldown-cmark's `html::push_html`,
which HTML-entity-escapes Event::Text — so mermaid's core `-->` arrow
rendered as `-->` (and class-diagram `<|--` as `<|--`), and
mermaid.js rejected the diagram with "Syntax error in text". Reported by
a user against v0.6.0 and v0.8.0.

Re-tag the in-mermaid Text segments as Event::Html so they pass through
unescaped. Mermaid diagram source contains no HTML tags; a `
` smuggled into a ```mermaid block would at worst close the block early, and `