fix: correct mermaid flowchart edge label syntax (-->|label| not --|"label"|)
This commit is contained in:
@@ -225,17 +225,17 @@ impl MermaidRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for ((source, target), count) in &module_edges {
|
for ((source, target), count) in &module_edges {
|
||||||
let arrow = if self.show_weights {
|
let line = if self.show_weights {
|
||||||
let label = if *count == 1 {
|
let label = if *count == 1 {
|
||||||
r#"|"1 dep"|"#.to_string()
|
"1 dep".to_string()
|
||||||
} else {
|
} else {
|
||||||
format!(r#"|"{count} deps"|"#)
|
format!("{count} deps")
|
||||||
};
|
};
|
||||||
format!("--{label}")
|
format!(" {source} -->|{label}| {target}")
|
||||||
} else {
|
} else {
|
||||||
"-->".to_string()
|
format!(" {source} --> {target}")
|
||||||
};
|
};
|
||||||
lines.push(format!(" {source} {arrow} {target}"));
|
lines.push(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
lines.join("\n")
|
lines.join("\n")
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ fn module_level_aggregates_cross_module_deps_into_single_arrow() {
|
|||||||
let content = output.files()[0].content();
|
let content = output.files()[0].content();
|
||||||
|
|
||||||
let arrow_count =
|
let arrow_count =
|
||||||
content.matches("Orders --> Infra").count() + content.matches("Orders --|").count();
|
content.matches("Orders --> Infra").count() + content.matches("Orders -->|").count();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
arrow_count, 1,
|
arrow_count, 1,
|
||||||
"should have exactly one aggregated arrow, got:\n{content}"
|
"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();
|
let content = output.files()[0].content();
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
content.contains(r#"|"2 deps"|"#),
|
content.contains("|2 deps|"),
|
||||||
"expected dep count label in: {content}"
|
"expected dep count label in: {content}"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -412,7 +412,7 @@ fn module_level_single_dep_uses_singular_label() {
|
|||||||
let content = output.files()[0].content();
|
let content = output.files()[0].content();
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
content.contains(r#"|"1 dep"|"#),
|
content.contains("|1 dep|"),
|
||||||
"expected singular dep label in: {content}"
|
"expected singular dep label in: {content}"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user