bugdown: Disallow ()[]{}<> in linkified URLs.

This allows us to handle messages like

    my website (available at http://google.com)

(imported from commit 51330507947fc039b6f29f06dfa1c6d21f779aa4)
This commit is contained in:
Keegan McAllister 2012-10-22 17:30:05 -04:00
parent 1c4bbd6a49
commit 05c08b41c4
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class Bugdown(markdown.Extension):
md.inlinePatterns.add('gravatar', Gravatar(r'!gravatar\((?P<email>[^)]*)\)'), '_begin')
# A link starts after whitespace and continues to the next whitespace.
link_regex = r'\b(?P<url>https?://[^\s]+)'
link_regex = r'\b(?P<url>https?://[^\s[\](){}<>]+)'
md.inlinePatterns.add('autolink', AutoLink(link_regex), '_begin')
# We need to re-initialize the markdown engine every 30 messages