When translating Dot to GXL, labels come out as strings. Input something like:
`label="foo"` and the GXL output is something like
`<attr name="label"><string>foo</string></attr>`. This translation is fine and
works well, until you start using HTML like labels.
Graphviz allows `<` and `>` as delimiters to indicate your label string contains
HTML that should be parsed. When you try to use this feature in combination with
gv2gxl, you get a lossy translation. E.g. the labels `label="foo"` and
`label=<foo>` come out identically in GXL.
This commit makes use of the GXL ‘kind’ field on attributes to note that the
source was an HTML like label. If you translate the two labels from above, you
will now get:
<attr name="label"><string>foo</string></attr>
and
<attr name="label" kind="HTML-like string"><string>foo</string></attr>
respectively.
This is a partial fix for #517. This makes the translation to GXL no longer
lossy. The other half of this is recognizing the ‘kind’ field during gxl2gv
translation and preserving it on the way back.
- Fix a typo `GD_LIBS` to `GDLIB_LIBS` in `tclpkg/tcldot/Makefile.am` !2022
- Autotools build system sets libgd variables now instead of incorrectly setting
GTK variables
+- HTML strings used as labels are distinguishable in GXL output by
+ `kind="HTML-like string"`
## [2.47.3] - 2021-06-19
fprintf(gxlFile, "\t</attr>\n");
} else {
tabover(gxlFile);
- fprintf(gxlFile, "\t<attr name=\"%s\">\n", xml_string(sym->name));
+ fprintf(gxlFile, "\t<attr name=\"%s\"", xml_string(sym->name));
+ if (aghtmlstr(data->str[sym->id])) {
+ // This is a <…> string. Note this in the kind.
+ fprintf(gxlFile, " kind=\"HTML-like string\"");
+ }
+ fprintf(gxlFile, ">\n");
tabover(gxlFile);
fprintf(gxlFile, "\t\t<string>%s</string>\n", xml_string(data->str[sym->id]));
tabover(gxlFile);