From 82f84d52bb82042c66809ba4278291dd787a35e3 Mon Sep 17 00:00:00 2001 From: Joseph O'Brien <98370624+89jobrien@users.noreply.github.com> Date: Thu, 2 Apr 2026 21:56:18 -0400 Subject: [PATCH] fix(notgraph): replace :: with / in module graph node labels to fix Mermaid parse error --- crates/notgraph/src/emit.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/notgraph/src/emit.rs b/crates/notgraph/src/emit.rs index 5bbbd8d..a6d3155 100644 --- a/crates/notgraph/src/emit.rs +++ b/crates/notgraph/src/emit.rs @@ -271,8 +271,10 @@ fn write_html( .strip_prefix(&format!("{}::", mg.krate)) .unwrap_or(node.as_str()); // Sanitize id for Mermaid (replace :: with __) + // Also sanitize label — :: inside quotes triggers a Mermaid parse error let id = node.replace("::", "__"); - d.push_str(&format!(" {}[\"{}\"]\n", id, short)); + let label = short.replace("::", "/"); + d.push_str(&format!(" {}[\"{}\"]\n", id, label)); } // Edges