Node names are inserted into the dot file without quotes or escaping of any kind.
Labeled edges are inserted into the dot file with quotes, but no escaping beyond that (e.g. a double quote in a labeled edge will break things).
This was easy to workaround like so:
class MyNodeType {
fun dotSafeIfWithinQuotes() = toString().replace("\"", "\\\"").replace("\n", "\\n")
fun dotSafe(): String = "\"${dotSafeIfWithinQuotes()}\""
}
...
digraph {
source.dotSafe() - target.dotSafe() + { this.label = edge.dotSafeIfWithinQuotes() }
}
Ideally strings would be automatically escaped correctly, but nbd, and fixing this would break any workarounds people are using now.
Great library that solved my problem quickly, thanks very much!
Node names are inserted into the
dotfile without quotes or escaping of any kind.Labeled edges are inserted into the
dotfile with quotes, but no escaping beyond that (e.g. a double quote in a labeled edge will break things).This was easy to workaround like so:
Ideally strings would be automatically escaped correctly, but nbd, and fixing this would break any workarounds people are using now.
Great library that solved my problem quickly, thanks very much!