]> granicus.if.org Git - graphviz/commitdiff
Make sure ids are emitted in anchor contexts in svg.
authorEmden Gansner <erg@research.att.com>
Wed, 23 May 2012 19:59:20 +0000 (15:59 -0400)
committerEmden Gansner <erg@research.att.com>
Wed, 23 May 2012 19:59:20 +0000 (15:59 -0400)
Thanks to Masatake YAMATO for the patches.

plugin/core/gvrender_core_svg.c

index 49a607fed5e3c3c9f85f1cf0bbc07b035dc2c221..e53339ffd5043c62963e8cb4648c4222babad408 100644 (file)
@@ -287,6 +287,14 @@ static void
 svg_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target,
                 char *id)
 {
+    gvputs(job, "<g");
+    if (id) {
+        gvputs(job, " id=\"");
+        gvputs(job, xml_string(id));
+        gvputs(job, "\"");
+    }
+    gvputs(job, ">");
+
     gvputs(job, "<a");
 #if 0
     /* the svg spec implies this can be omitted: http://www.w3.org/TR/SVG/linking.html#Links */
@@ -324,6 +332,7 @@ svg_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target,
 static void svg_end_anchor(GVJ_t * job)
 {
     gvputs(job, "</a>\n");
+    gvputs(job, "</g>\n");
 }
 
 static void svg_textpara(GVJ_t * job, pointf p, textpara_t * para)