Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#161 closed defect (fixed)

URL regular expression is incorrect

Reported by: eblot Owned by: pkropf
Priority: high Component: GraphvizPlugin
Severity: normal Keywords:
Cc: Trac Release:


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/        (revision 415)
+++ graphviz/        (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 11 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with changeset:550.

Add Comment

Modify Ticket

as closed The owner will remain pkropf.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.