Subject: | Doesn't handle dot keywords as node names |
Hi,
In the attached file is show_graphviz_pm_bug.pl which shows an example
of the problem. Basically GraphViz.pm doesn't treat dot keywords such as
'node' and 'edge' as special cases. By not doing so these nodes don't
make it into the graph diagram and cause dot to give warnings (see the
before and after files in the .zip attached). Since there's already a
special case for graph as a node name why not add the other key words too?
Here's a fix that I've found to work:
Show quoted text
> my $GRAPHVIZ_KEYWORD = qr/^(strict|node|edge|graph|digraph|subgraph)$/o;
sub _quote_name {
my($self, $name) = @_;
my $realname = $name;
return $self->{_QUOTE_NAME_CACHE}->{$name} if $name && exists
$self->{_QUOTE_NAME_CACHE}->{$name};
< if (defined $name && $name =~ /^[a-zA-Z]\w*$/ && $name ne "graph") {
Show quoted text> if (defined $name && $name =~ /^[a-zA-Z]\w*$/ && $name !~
$GRAPHVIZ_KEYWORD) {
Regards,
Adrian
Subject: | GraphViz Bug.zip |