Modify ↓
#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)
Note: See
TracTickets for help on using
tickets.
Fixed with changeset:550.