fix: correct mermaid flowchart edge label syntax (-->|label| not --|"label"|)
Some checks failed
CI / Check / Test (push) Failing after 1m40s
Architecture Docs / Generate diagrams (push) Successful in 3m51s

This commit is contained in:
2026-06-17 10:09:44 +02:00
parent b2ce4b4ee9
commit 134c46da43
2 changed files with 9 additions and 9 deletions

View File

@@ -225,17 +225,17 @@ impl MermaidRenderer {
}
for ((source, target), count) in &module_edges {
let arrow = if self.show_weights {
let line = if self.show_weights {
let label = if *count == 1 {
r#"|"1 dep"|"#.to_string()
"1 dep".to_string()
} else {
format!(r#"|"{count} deps"|"#)
format!("{count} deps")
};
format!("--{label}")
format!(" {source} -->|{label}| {target}")
} else {
"-->".to_string()
format!(" {source} --> {target}")
};
lines.push(format!(" {source} {arrow} {target}"));
lines.push(line);
}
lines.join("\n")

View File

@@ -321,7 +321,7 @@ fn module_level_aggregates_cross_module_deps_into_single_arrow() {
let content = output.files()[0].content();
let arrow_count =
content.matches("Orders --> Infra").count() + content.matches("Orders --|").count();
content.matches("Orders --> Infra").count() + content.matches("Orders -->|").count();
assert_eq!(
arrow_count, 1,
"should have exactly one aggregated arrow, got:\n{content}"
@@ -374,7 +374,7 @@ fn module_level_shows_dep_count_as_edge_label() {
let content = output.files()[0].content();
assert!(
content.contains(r#"|"2 deps"|"#),
content.contains("|2 deps|"),
"expected dep count label in: {content}"
);
}
@@ -412,7 +412,7 @@ fn module_level_single_dep_uses_singular_label() {
let content = output.files()[0].content();
assert!(
content.contains(r#"|"1 dep"|"#),
content.contains("|1 dep|"),
"expected singular dep label in: {content}"
);
}