From 1c4bbd6a49870a3a2402b661db38f752fc3597ea Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 22 Oct 2012 17:24:12 -0400 Subject: [PATCH] bugdown: Start a URL with a word boundary, not a space This fixes the bug where we were eating the preceding space. (imported from commit 9eca01e6ad828ccc31ad10693339f381333e76a7) --- zephyr/lib/bugdown/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/lib/bugdown/__init__.py b/zephyr/lib/bugdown/__init__.py index 9316652e09..9057baa906 100644 --- a/zephyr/lib/bugdown/__init__.py +++ b/zephyr/lib/bugdown/__init__.py @@ -33,7 +33,7 @@ class Bugdown(markdown.Extension): md.inlinePatterns.add('gravatar', Gravatar(r'!gravatar\((?P[^)]*)\)'), '_begin') # A link starts after whitespace and continues to the next whitespace. - link_regex = r'(\s|\A)(?Phttps?://[^\s]+)' + link_regex = r'\b(?Phttps?://[^\s]+)' md.inlinePatterns.add('autolink', AutoLink(link_regex), '_begin') # We need to re-initialize the markdown engine every 30 messages