From 8423a7e788e2d9ab9d63d8e3011f8fcaf2be4b63 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 24 Apr 2025 20:56:52 +0200 Subject: [PATCH] dot: quote nodes in dotlang to allow for special chars [sr: replace "\"%s\"" with "%q", don't escape in HTML label which causes extra quotes] Signed-off-by: Luca --- dot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot.go b/dot.go index 8ed8df9..c0f058e 100644 --- a/dot.go +++ b/dot.go @@ -31,7 +31,7 @@ func writeDot(cfg *Config, path string) error { as = append(as, fmt.Sprintf(" %s 
", html.EscapeString(x.String()))) } - fmt.Fprintf(w, "%s [label=<%s>]\n", + fmt.Fprintf(w, "%q [label=<%s>]\n", node.Name, strings.Join(as, "")) } @@ -46,7 +46,7 @@ func writeDot(cfg *Config, path string) error { abs = append(abs, fmt.Sprintf(" %s 
", html.EscapeString(x.Addr().String()))) } - fmt.Fprintf(w, "%s -- %s [taillabel=<%s>,headlabel=<%s>,labelfontsize=10]\n", + fmt.Fprintf(w, "%q -- %q [taillabel=<%s>,headlabel=<%s>,labelfontsize=10]\n", link.A.Node.Name, link.B.Node.Name, strings.Join(aas, ""), strings.Join(abs, "")) } -- 2.49.0