Commits

David Cramer committed 7e8b86e

case insensitive opening pattern for automatch urls

  • Participants
  • Parent commits 098c2c1

Comments (0)

Files changed (1)

File bbcode/bbtags/web.py

 class AutoDetectURL(SelfClosingTagNode):
     # XXX: might be better to enumerate words rather than use regexp?
     #open_pattern = re.compile(r'(?P<before>[^\]])(?P<url>(?:http|ftp|https)://[\w\-_]+(?:\.[\w\-_]+)+(?:[\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?', re.I)
-    open_pattern = re.compile(r'(?P<before>[^\]=])(?P<url>(?:(?P<protocol>https?|ftp)://(?:\w+@)?|www\.)[\w.-]+(?:/\S+)?)(?P<after>\b)')
+    open_pattern = re.compile(r'(?P<before>[^\]=])(?P<url>(?:(?P<protocol>https?|ftp)://(?:\w+@)?|www\.)[\w.-]+(?:/\S+)?)(?P<after>\b)', re.I)
     # open_pattern = re.compile(r'(?P<before>[^[\]])(?P<url>(?P<protocol>(?:ht|f)tp(?:s?)\:\/\/|~/|/'
     #                           ')?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomain'
     #                           's)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org'