Simplify hurl regex
authorBernie Innocenti <bernie@codewiz.org>
Mon, 2 Jun 2008 06:36:22 +0000 (08:36 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 2 Jun 2008 06:36:22 +0000 (08:36 +0200)
geekigeeki.py

index 3b66445ab80b4665304db00481b344b31b4376e1..41345e65340c2b711581a1d9ce097a69968395a6 100755 (executable)
@@ -506,13 +506,14 @@ 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>\[\[([^ \t\n\r\f\v\|]+)(?:\s*\|\s*([^\]]+)|)\]\])"
+            + r"|(?P<hurl>\[\[([^ \s\|]+)(?:\s*\|\s*([^\]]+)|)\]\])"
             + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)"
             + r"|(?P<email>[-\w._+]+\@[\w.-]+)"
 
             # Lists, divs, spans
             + r"|(?P<li>^\s+[\*#] +)"
             + r"|(?P<pre>\{\{\{|\s*\}\}\})"
+            + r"|(?P<hurl>\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})"
 
             # Tables
             + r"|(?P<tr>^\s*\|\|(=|)\s*)"