Skip Menu |

This queue is for tickets about the GraphViz2 CPAN distribution.

Report information
The Basics
Id: 72259
Status: resolved
Priority: 0/
Queue: GraphViz2

People
Owner: Nobody in particular
Requestors: fitz.elliott [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.10
Fixed in: (no value)



Subject: Double-quote escaping for HTML labels
Hello, GraphViz2 v1.10 escapes double-quotes in HTML labels, where they are valid characters needed for specifying attributes. Attached is a failing test case for scripts/html.labels.pl and a patch for GraphViz2.pm that only escapes double quotes if the label is not an HTML label. Thank you for your work on this module! Cheers, Fitz Elliott
Subject: dont-escape-html-dquotes.patch
diff --git a/lib/GraphViz2.pm b/lib/GraphViz2.pm index 9847624..1fe085f 100644 --- a/lib/GraphViz2.pm +++ b/lib/GraphViz2.pm @@ -131,7 +131,12 @@ sub add_node { # HTML labels affect this code. - $arg{label} =~ s#([[\]{}"])#\\$1#g; + $arg{label} =~ s#([[\]{}])#\\$1#g; + + if ($arg{label} !~ m/^</) # if not an HTML label + { + $arg{label} =~ s/"/\\"/g; + } } $$node{$name}{attributes} = {%arg}; diff --git a/scripts/html.labels.pl b/scripts/html.labels.pl index 9371a92..c210563 100644 --- a/scripts/html.labels.pl +++ b/scripts/html.labels.pl @@ -43,7 +43,7 @@ $graph -> add_node(name => 'Carnegie', color => 'red'); $graph -> default_node(style => 'rounded'); -$graph -> add_node(name => 'Murrumbeena', shape => 'box', color => 'green', label => '<Murrumbeena<br/>Victoria<br/>Australia>'); +$graph -> add_node(name => 'Murrumbeena', shape => 'box', color => 'green', label => '<Murrumbeena<br/><FONT COLOR="#99999">Victoria</FONT><br/>Australia>'); $graph -> add_node(name => 'Oakleigh', shape => 'record', color => 'blue', label => ['West Oakleigh', 'East Oakleigh']); $graph -> add_edge(from => 'Murrumbeena', to => 'Carnegie', arrowsize => 2, label => '<Bike<br/>Train<br/>Stroll>');
Subject: Re: [rt.cpan.org #72259] Double-quote escaping for HTML labels
Date: Tue, 08 Nov 2011 09:54:12 +1100
To: bug-GraphViz2 [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Fitz On Mon, 2011-11-07 at 17:32 -0500, Fitz Elliott via RT wrote: Show quoted text
> Mon Nov 07 17:32:52 2011: Request 72259 was acted upon.
Thanx for the patch. It looks like line 115 needs to be patched too. A few minutes ago I received another error report [1], and I'll wait for answers to some questions I have about that before issuing a bug fix, but I won't wait more than a day or two. [1] https://rt.cpan.org/Public/Bug/Display.html?id=69076 -- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Hi Fitz This double-quote escaping problem has been fixed in V 1.11. $many x $thanx;