Update regular expression to be somewhat sane.
authorbsmedberg@pistons.dreamhost.com
Mon, 01 Aug 2011 08:04:39 -0700
changeset 31 aebc38b082a3
parent 30 d4fe0f2a63ad
child 32 11f31b62f654
push id27
push userbsmedberg@mozilla.com
push date2012-01-31 17:15 +0000
Update regular expression to be somewhat sane.
weeklyupdates/post.py
old mode 100644
new mode 100755
--- a/weeklyupdates/post.py
+++ b/weeklyupdates/post.py
@@ -1,16 +1,16 @@
 import datetime
 from genshi.filters import HTMLSanitizer
 from genshi.input import HTML, ParseError
 import markdown2
 import re
 
 link_patterns = (
-    (re.compile(r'(https?://.*\b)'), r'\1'),
+    (re.compile(r'(https?://.*?(?=[\s\]\)\|]))'), r'\1'),
     (re.compile(r'bug[\s:#]+(\d{3,7})\b'), r'https://bugzilla.mozilla.org/show_bug.cgi?id=\1'),
 )
 
 md = markdown2.Markdown(html4tags=True, tab_width=2,
                         extras=['link-patterns',
                                 'cuddled-lists'],
                         link_patterns=link_patterns)