Skip to content

Commit 7c2f6da

Browse files
committed
fix: prevent double-escaping of newlines in D2 container labels
escape_d2() was applied after name_lines(), which turned the \n line separators into \\n (literal backslash-n in D2 output). Swapping the order escapes D2-special characters first, then inserts line breaks that D2 interprets correctly.
1 parent 70f179c commit 7c2f6da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mk_graph/output/d2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn render_d2_function(
6666
out: &mut String,
6767
) {
6868
let fn_id = short_name(name);
69-
let display_name = escape_d2(&name_lines(name));
69+
let display_name = name_lines(&escape_d2(name));
7070

7171
// Function container
7272
out.push_str(&format!("{}: {{\n", fn_id));

0 commit comments

Comments
 (0)