Modify ↓
Opened 15 years ago
Closed 15 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): 43 43 ENDBLOCK_TOKEN = r"\}\}\}" 44 44 ENDBLOCK = "}}}" 45 45 46 LINK_SCHEME = r"[a-zA-Z][ a-zA-Z0-9+-.]*" # as per RFC 239646 LINK_SCHEME = r"[a-zA-Z][-a-zA-Z0-9+.]*" # as per RFC 2396 47 47 INTERTRAC_SCHEME = r"[a-zA-Z.+-]*?" # no digits (for shorthand links) 48 48 49 49 QUOTED_STRING = r"'[^']+'|\"[^\"]+\""
Attachments (0)
Note:
See TracTickets
for help on using tickets.



See how stupid that regexp parser is, it couldn't see that I didn't want a range in that case.
:-)
Good catch!