Project

General

Profile

Actions

Defect #1456

closed

Invalid html generated by wiki formatter

Added by Pierre Paysant-Le Roux almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Wiki
Target version:
Start date:
2008-06-15
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Links generated by the wiki are invalid when they contain something that could be an email. For example, this :

http://foo@www.bar.com

is transformed to

<a class=\"external\" href=\"http://<a href=\"mailto:www.foo@bar.com\" class=\"email\">www.foo@bar.com</a>\">http://<a href=\"mailto:www.foo@bar.com\" class=\"email\">www.foo@bar.com</a></a>

and rendered as this http://foo@www.bar.com in a web browser.

I observed this problem by using hg fetch that generates commit messages like :

Automated merge with https://login@hg.foo.com/project.

Here is a patch that solves the problem and a unit test. The code come from http://dev.rubyonrails.org/changeset/7516. The only limitation of this solution is in that case :

http://foo@bar.com foo@bar.com

where only the first link is detected. I did not found the magic regexp. Maybe this could be solved with some lookbehind but the syntax is not supported on ruby 1.8.


Files

wiki_formatting_links.patch (798 Bytes) wiki_formatting_links.patch Wiki links patch Pierre Paysant-Le Roux, 2008-06-16 00:05
Actions #1

Updated by Jean-Philippe Lang almost 16 years ago

  • Status changed from New to Closed
  • Target version set to 0.8
  • Affected version (unused) set to 0.7.2
  • Resolution set to Fixed
  • Affected version set to 0.7.2

Fix committed in r1559. Thanks.

Actions

Also available in: Atom PDF