Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

#9712 closed defect (fixed)

[PATCH] wiki.formatter generates a link from "x,://localhost/", it is not RFC 2396 compatible.

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.2
Component: wiki system Version: 0.13dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In RFC 2396, scheme does not include comma.

      scheme        = alpha *( alpha | digit | "+" | "-" | "." )

However HtmlFormatter generates a link from x,://localhost/ because WikiParser.LINK_SCHEME matches x,.

  • trac/wiki/parser.py

    diff --git a/trac/wiki/parser.py b/trac/wiki/parser.py
    index 49d1a5e..02f8a2e 100644
    a b class WikiParser(Component):  
    4343    ENDBLOCK_TOKEN = r"\}\}\}"
    4444    ENDBLOCK = "}}}"
    4545
    46     LINK_SCHEME = r"[a-zA-Z][a-zA-Z0-9+-.]*" # as per RFC 2396
     46    LINK_SCHEME = r"[a-zA-Z][-a-zA-Z0-9+.]*" # as per RFC 2396
    4747    INTERTRAC_SCHEME = r"[a-zA-Z.+-]*?" # no digits (for shorthand links)
    4848
    4949    QUOTED_STRING = r"'[^']+'|\"[^\"]+\""

Attachments (0)

Change History (2)

comment:1 by Christian Boos, 14 years ago

Milestone: 0.12.2
Owner: set to Jun Omae

See how stupid that regexp parser is, it couldn't see that I didn't want a range in that case.

:-)

Good catch!

comment:2 by Christian Boos, 14 years ago

Resolution: fixed
Status: newclosed

Fix applied in r10287.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.