Modify

Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#161 closed defect (fixed)

URL regular expression is incorrect

Reported by: Emmanuel Blot Owned by: Peter Kropf
Priority: high Component: GraphvizPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

The regular expression used to expand wiki links is incorrect

It is too greedy with the URL characters, which leads to include non-URL information into the URL group.

For example, in the following graphviz data extract:

my_node [URL="http://server/trac/project/changeset/164",tooltip="author"]

the RE engine considers that ",tooltip="author is part of the URL definition, which is incorrect.
The URL ends up corrupted, double-quote are escaped (sanitized), and the tooltip is destroyed.

Index: graphviz/graphviz.py
===================================================================
--- graphviz/graphviz.py        (revision 415)
+++ graphviz/graphviz.py        (working copy)
@@ -151,7 +152,7 @@
 
             self.log.debug('render_macro.URL_in_graph: %s' % str(URL_in_graph))
             if URL_in_graph: # translate wiki TracLinks in URL
-                content = re.sub(r'URL="(.*)"', self.expand_wiki_links, content)
+                content = re.sub(r'URL="(.*?)"', self.expand_wiki_links, content)
 
             # Antialias PNGs with rsvg, if requested
             if self.out_format == 'png' and self.png_anti_alias == True:

Attachments (0)

Change History (1)

comment:1 Changed 19 years ago by anonymous

Resolution: fixed
Status: newclosed

Fixed with changeset:550.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Kropf.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.