diff --git a/zephyr/lib/bugdown/__init__.py b/zephyr/lib/bugdown/__init__.py index 2dc3352753..6f206cd08f 100644 --- a/zephyr/lib/bugdown/__init__.py +++ b/zephyr/lib/bugdown/__init__.py @@ -565,7 +565,7 @@ class Bugdown(markdown.Extension): # This rule must come after the http_autolink rule we add above to avoid double # linkifying. tlds = '|'.join(list_of_tlds()) - link_regex = r"\b(?P[^\s]+\.(%s)(?:/[^\s()\":]*?|([^\s()\":]*\([^\s()\":]*\)[^\s()\":]*))?)(?=([:;\?\),\.\'\"]\Z|[:;\?\),\.\'\"]\s|\Z|\s))" % (tlds,) + link_regex = r"\b(?P[^\s]+\.(%s)(?:/[^\s()\":]*?|(/[^\s()\":]*\([^\s()\":]*\)[^\s()\":]*))?)(?=([:;\?\),\.\'\"]\Z|[:;\?\),\.\'\"]\s|\Z|\s))" % (tlds,) md.inlinePatterns.add('autolink', AutoLink(link_regex), '>http_autolink') md.preprocessors.add('hanging_ulists', diff --git a/zephyr/tests.py b/zephyr/tests.py index a24b2032c9..1b09a7d006 100644 --- a/zephyr/tests.py +++ b/zephyr/tests.py @@ -2139,7 +2139,11 @@ int x = 3 # to avoid triggering the inline image preview support ('http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov', "

%s

", - 'http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov')] + 'http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov'), + + # Just because it has a TLD and parentheses in it doesn't mean it's a link. Trac #1364 + ('a.commandstuff()', '

a.commandstuff()

', ''), + ] for inline_url, reference, url in conversions: try: