X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4cb343f3482edc3786ea46eea7efb7762d349164..f32f6411ff604a879151ab329907afca351ea3b6:/IkiWiki/Plugin/graphviz.pm?ds=inline

diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index 0889bc9fc..d4018edaa 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");
@@ -124,6 +132,7 @@ sub graph (@) {
 		}, "text");
 		$p->parse($src);
 		$p->eof;
+		$s=~s/\[ href= \]//g; # handle self-links
 		$params{src}=$s;
 	}
 	else {