Tcl_DeleteCommand(gctx->ictx->interp, hndl);
}
+static void myagxset(void *obj, Agsym_t *a, char *val)
+{
+ int len;
+ char *hs;
+
+ if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, "label") == 0) {
+ len = strlen(val);
+ if (val[len-1] == '>') {
+ hs = strdup(val+1);
+ *(hs+len-2) = '\0';
+ val = agstrdup_html(agraphof(obj),hs);
+ free(hs);
+ }
+ }
+ agxset(obj, a, val);
+}
void setgraphattributes(Agraph_t * g, char *argv[], int argc)
{
int i;
for (i = 0; i < argc; i++) {
if (!(a = agfindgraphattr(agroot(g), argv[i])))
a = agattr(agroot(g), AGRAPH, argv[i], "");
- agxset(g, a, argv[++i]);
+ myagxset(g, a, argv[++i]);
}
}
if (e) {
if (!(a = agfindedgeattr(g, argv[i])))
a = agattr(agroot(g), AGEDGE, argv[i], "");
- agxset(e, a, argv[++i]);
+ myagxset(e, a, argv[++i]);
}
else {
agattr(g, AGEDGE, argv[i], argv[i+1]);
if (n) {
if (!(a = agfindnodeattr(g, argv[i])))
a = agattr(agroot(g), AGNODE, argv[i], "");
- agxset(n, a, argv[++i]);
+ myagxset(n, a, argv[++i]);
}
else {
agattr(g, AGNODE, argv[i], argv[i+1]);