nidi3 / graphviz-java

Use graphviz with pure java
Apache License 2.0
934 stars 106 forks source link

"\G" not supported by attribute fields #176

Closed pauls4GE closed 4 years ago

pauls4GE commented 4 years ago

If there is "\G" in any attribute value in the .dot file, the .svg created replaces the "\G" with the name of the graph. E.g. -- For the graph below digraph CASE{ a [label ="\a\b\G\a\B\C\h"] a -> c; a -> b; b -> c [constraint=false]; }

The corresponding .svg shows: image

nidi3 commented 4 years ago

That's feature of graphviz. http://www.graphviz.org/doc/info/attrs.html (search for \G) Why would you use invalid escape sequences like \a, \b anyways?

pauls4GE commented 4 years ago

So my use case was populating the graph with some user defined URLs. Some windows users prefer to specify paths using '\'. I came across this issue and thought it was a bug.

nidi3 commented 4 years ago

But then you would need to replace "\" with "\\" to show a backslash and \G wouldn't be a problem, right?

pauls4GE commented 4 years ago

Yes. I figured out my way around this. I was just expecting the dot parser to handle content within " " automatically by recognizing that whatever is inside is not an escape sequence.