Edgewall Software

Ticket #2455 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Ampersand following a short link

Reported by: moschny at ipd.uni-karlsruhe.de Owned by: cboos
Priority: normal Milestone: 0.10
Component: wiki system Version: 0.9.2
Severity: minor Keywords: review
Cc:

Description

An ampersand put directly after a short reference is rendered incorrectly and creates a broken link.

Example: "ticket:1153&" is rendered as ticket:1153& ("ticket:1153&;" for trac 0.9.2) and the generated link ends in "...1153&amp".

If the ampersand is followed by whitespace, it should not be treated as part of the link target.

This is a left-over from ticket:1153.

Attachments

dont_escape_wiki_text_beforehand-r2636.patch (7.7 kB) - added by cboos 3 years ago.
Don't HTML escape the wiki text before parsing. The HTML escaping is instead done as a normal formatting step.
dont_escape_wiki_text_beforehand-r2636.2.patch (7.5 kB) - added by moschny at ipd.uni-karlsruhe.de 3 years ago.
More escaping in formatter.py/_make_ext_link().

Change History

Changed 3 years ago by cboos

Don't HTML escape the wiki text before parsing. The HTML escaping is instead done as a normal formatting step.

Changed 3 years ago by cboos

  • keywords review added
  • owner changed from jonas to cboos
  • status changed from new to assigned

Updated the patch on #1153 against the current trunk.

Please review.

Changed 3 years ago by moschny at ipd.uni-karlsruhe.de

More escaping in formatter.py/_make_ext_link().

Changed 3 years ago by moschny at ipd.uni-karlsruhe.de

In trac/wiki/formatter.py/_make_ext_link(), url, text and title should be esacped, I think. Here's an updated patch.

BTW: How do I run the tests?

Changed 3 years ago by cboos

Ok. For the tests, I use:

PYTHONPATH=".;$PYTHONPATH" python trac/test.py

on Windows; similar stuff on Unix, simply replace ";" by ":".

Changed 3 years ago by moschny at ipd.uni-karlsruhe.de

Ok, thanks. The patched version passes all 416 tests.

Changed 3 years ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Changed 3 years ago by cmlenz

  • milestone changed from 1.0 to 0.10

Add/Change #2455 (Ampersand following a short link)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.