}
static void
-setEdgeAttr(Agedge_t * ep, char *name, char *value, userdata_t * ud)
+setEdgeAttr(Agedge_t * ep, char *name, char *value, userdata_t * ud,
+ bool is_html)
{
Agsym_t *ap;
char *attrname;
ap = agattr(root, AGEDGE, name, defval);
}
- agxset(ep, ap, value);
+ if (is_html) {
+ char *val = agstrdup_html(root, value);
+ agxset(ep, ap, val);
+ agstrfree(root, val); // drop the extra reference count we bumped for val
+ } else {
+ agxset(ep, ap, value);
+ }
}
/* setGlobalEdgeAttr:
setNodeAttr(N, name, value, ud, false);
break;
case TAG_EDGE:
- setEdgeAttr(E, name, value, ud);
+ setEdgeAttr(E, name, value, ud, false);
break;
}
}
pos = get_xml_attr("fromorder", atts);
if (pos > 0) {
- setEdgeAttr(E, GXL_FROM, (char *) atts[pos], ud);
+ setEdgeAttr(E, GXL_FROM, (char *) atts[pos], ud, false);
}
pos = get_xml_attr("toorder", atts);
if (pos > 0) {
- setEdgeAttr(E, GXL_TO, (char *) atts[pos], ud);
+ setEdgeAttr(E, GXL_TO, (char *) atts[pos], ud, false);
}
pos = get_xml_attr("id", atts);
if (pos > 0) {
- setEdgeAttr(E, GXL_ID, (char *) atts[pos], ud);
+ setEdgeAttr(E, GXL_ID, (char *) atts[pos], ud, false);
}
} else if (strcmp(name, "attr") == 0) {
const char *attrname = atts[get_xml_attr("name", atts)];