XML-escape xlink:href attribute in SVG
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 29 Mar 2020 14:20:56 +0000 (16:20 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 29 Mar 2020 14:20:59 +0000 (16:20 +0200)
Fixes https://gitlab.com/graphviz/graphviz/-/issues/1687

plugin/core/gvrender_core_svg.c

index a24b5336528177c25461fdbe85d2d7424cc570fc..141175d5f0b259dedb2a5453c3f72cbf90998659 100644 (file)
@@ -350,7 +350,7 @@ svg_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target,
 #endif
     if (href && href[0]) {
        gvputs(job, " xlink:href=\"");
-       gvputs(job, href);
+       gvputs(job, xml_url_string(href));
        gvputs(job, "\"");
     }
 #if 0