Allow [[foo|bar]] with no spaces in between
authorBernardo Innocenti <bernie@codewiz.org>
Mon, 17 Dec 2007 10:53:01 +0000 (11:53 +0100)
committerBernardo Innocenti <bernie@codewiz.org>
Mon, 17 Dec 2007 10:53:01 +0000 (11:53 +0100)
geekigeeki.py

index 43b9cc1107ac68b484b205b86e69f79d18107b25..d8d984a40e7bc3e9d5f0216c674ad368d85dc7fb 100755 (executable)
@@ -389,7 +389,7 @@ class PageFormatter:
             return '<a href="%s" rel="nofollow" class="external">%s</a>' % (word, word)
 
     def _hurl_repl(self, word):
-        m = re.compile("\[\[(\S+)(?:\s*\|\s*([^\]]*)|)\]\]").match(word)
+        m = re.compile("\[\[([^ \t\n\r\f\v\|]+)(?:\s*\|\s*([^\]]+)|)\]\]").match(word)
         name = m.group(1)
         descr = m.group(2) or name
 
@@ -511,7 +511,7 @@ class PageFormatter:
             # Links
             + r"|(?P<img>\b[a-zA-Z0-9_-]+\.(png|gif|jpg|jpeg|bmp))"
             + r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)"
-            + r"|(?P<hurl>\[\[(\S+)(?:\s*\|\s*([^\]]*)|)\]\])"
+            + r"|(?P<hurl>\[\[([^ \t\n\r\f\v\|]+)(?:\s*\|\s*([^\]]+)|)\]\])"
             + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)"
             + r"|(?P<email>[-\w._+]+\@[\w.-]+)"