Anonymous committed 77d47b2

0.12.2dev: Allow the underscore in link schemes, even though it's not RFC:2396 compliant, as it seems to be in widespread use in InterMapTxt.

  • Participants
  • Parent commits ac1a727
  • Branches 0.12-stable

Comments (0)

Files changed (3)

File trac/wiki/

     ENDBLOCK_TOKEN = r"\}\}\}"
     ENDBLOCK = "}}}"
-    LINK_SCHEME = r"[a-zA-Z][-a-zA-Z0-9+.]*" # as per RFC 2396
+    LINK_SCHEME = r"[a-zA-Z][-a-zA-Z0-9+._]*" # as per RFC 2396 + '_'
     INTERTRAC_SCHEME = r"[a-zA-Z.+-]*?" # no digits (for shorthand links)
     QUOTED_STRING = r"'[^']+'|\"[^\"]+\""

File trac/wiki/tests/

         # -- safe schemes
         self.env.config.set('wiki', 'safe_schemes',
-                            'rfc-2396.compatible')
+                            'rfc-2396.compatible,rfc-2396+under_score')
         # TODO: remove the following lines in order to discover
         #       all the places were we should use the req.href

File trac/wiki/tests/wiki-tests.txt

 [svn+ssh:// SVN link]
 [rfc-2396.compatible://link RFC 2396]
+[rfc-2396+under_score://link underscore]
 unsafe://scheme is not rendered
 <a class="ext-link" href="svn+ssh://"><span class="icon"> </span>SVN link</a>
 <a class="ext-link" href="rfc-2396.compatible://link"><span class="icon"> </span>rfc-2396.compatible://link</a>
 <a class="ext-link" href="rfc-2396.compatible://link"><span class="icon"> </span>RFC 2396</a>
+<a class="ext-link" href="rfc-2396+under_score://link"><span class="icon"> </span>rfc-2396+under_score://link</a>
+<a class="ext-link" href="rfc-2396+under_score://link"><span class="icon"> </span>underscore</a>
 unsafe://scheme is not rendered