Subject: | as_graphviz() quoting of attribute values |
Date: | Thu, 11 Jun 2015 22:23:07 +1000 |
To: | bug-Graph-Easy [...] rt.cpan.org |
From: | Kevin Ryde <user42_kevin [...] yahoo.com.au> |
If a graph attribute value starts with a digit but is not a number, then
as_graphviz() does not quote it the way the graphviz dot program
requires. For example foo.pl below gives
graph [ rankdir=LR, root=0e ];
which dot doesn't like
Warning: syntax ambiguity - badly delimited number '0e' in line 6 of /tmp/foo.dot splits into two tokens
Error: /tmp/foo.dot: syntax error in line 6 near ']'
(The graphviz docs say an alphanumeric bare ID can't start with a
digit.)
It looks like " characters in an attribute value should be escaped too.
bar.pl below gives
graph [ rankdir=LR, root="qq"qq" ];
...
"qq\"qq" [ rank=0 ]
The node name part is escaped correctly, but not the attribute part
Error: /tmp/foo.dot: syntax error in line 6 near '"'
A quote in a node name is hopefully unusual, but dot seems to allow it
if escaped.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.