From 6cadcacffd76cf60739372029fb73ff333bdd6e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Nov 2011 16:25:17 -0400 Subject: [PATCH] apply Postel's law --- IkiWiki/Plugin/graphviz.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index 0889bc9fc..b9f997e04 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -112,7 +112,15 @@ sub graph (@) { $p->handler(start => sub { my %attrs=%{shift()}; if (exists $attrs{href}) { - $s.="\"$attrs{href}\""; + if ($s=~/href\s*=\s*"$/) { + $s.=$attrs{href}; + } + elsif ($s=~/href\s*=\s*$/) { + $s.="\"$attrs{href}\""; + } + else { + $s.="href=\"$attrs{href}\""; + } } $nested++; }, "attr"); -- 2.26.2