Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML strings rejected #19

Open
PlanetEarthSoftware opened this issue Dec 7, 2024 · 1 comment
Open

HTML strings rejected #19

PlanetEarthSoftware opened this issue Dec 7, 2024 · 1 comment

Comments

@PlanetEarthSoftware
Copy link

Dot allows html rather than text labels, delimited by angle brackets, e.g:

digraph D {

  node [shape=plaintext]

  FOO [ label = <The <font color='red'><b>foo</b></font>,<br/> the <font point-size='20'>bar</font> and<br/> the <i>baz</i>> ];

  FOO -> {BAR, BAZ};

}

HTML node label.dot.zip

HTML node label dot

This would be tricky to add and maintain backwards compatibility, we need to know whether the string was a normal string/"quoted string" or an .
Idea 1. Store the html string with the normal strings but have a method on Edge isHtml(string) that checks if the string was an html string, stored, possibly if F# supports it, a new HashMap(ReferenceEqualityComparer.Instance) where the string is matched by reference equals, checking it is the same string, rather than a string with the same value.

Idea 2. (not backwards compatible) store a DotString or a HtmlString both derived from DotValue so the reader can check which type of string it is. HtmlString could have a method getString() to extract just the text and convert
to '\n'.

@PlanetEarthSoftware
Copy link
Author

One can not derived a class from string as .net string is sealed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant