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&".
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
Change History
Changed 6 years ago by cboos
- Attachment dont_escape_wiki_text_beforehand-r2636.patch added
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
- Attachment dont_escape_wiki_text_beforehand-r2636.2.patch added
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
Slightly modified attachment:dont_escape_wiki_text_beforehand-r2636.2.patch
applied in r2644.
comment:6 Changed 6 years ago by cmlenz
- Milestone changed from 1.0 to 0.10



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