Edgewall Software
Modify

Ticket #2455 (closed defect: fixed)

Opened 6 years ago

Last modified 6 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:
Release Notes:
API Changes:

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 6 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 6 years ago.
More escaping in formatter.py/_make_ext_link().

Download all attachments as: .zip

Change History

Changed 6 years ago by cboos

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

comment:1 Changed 6 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 6 years ago by moschny at ipd.uni-karlsruhe.de

More escaping in formatter.py/_make_ext_link().

comment:2 Changed 6 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?

comment:3 Changed 6 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 ":".

comment:4 Changed 6 years ago by moschny at ipd.uni-karlsruhe.de

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

comment:5 Changed 6 years ago by cboos

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

comment:6 Changed 6 years ago by cmlenz

  • Milestone changed from 1.0 to 0.10
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.