Commits

Anonymous committed 9d3e790

Tweak regex to use a word boundary anchor + negative lookbehind to avoid linking issues in URLs.

  • Participants
  • Parent commits 6bc52d7

Comments (0)

Files changed (2)

File extensions/local_replace.py

 
 
 # if the issue number is too big the db will explode -- limit it to 7 digits
-issue_re = re.compile(r'(?P<text>(\#|issue)\s*(?P<id>1?\d{1,6}))\b', re.I)
+issue_re = re.compile(r'(?P<text>(\#|\b(?<!/)issue)\s*(?P<id>1?\d{1,6}))\b', re.I)
 
 
 class PyDevStringHTMLProperty(StringHTMLProperty):

File extensions/test/test_local_replace.py

     (' #2000000 ', ' #2000000 '),
     (' # 2000000 ', ' # 2000000 '),
     (' #1234567890123  ', ' #1234567890123  '),
+    ('pyissue1000', 'pyissue1000'),
 
     ## Lib/somefile.py, Modules/somemodule.c, Doc/somedocfile.rst, ...
     ('Lib/cgi.py',
     ('http://svn.python.org/view/python/tags/r265/Lib/cgi.py?view=markup',
      ('<a href="http://svn.python.org/view/python/tags/r265/Lib/cgi.py?view=markup">'
       'http://svn.python.org/view/python/tags/r265/Lib/cgi.py?view=markup</a>')),
+    ('http://bugs.python.org/issue1000',
+     '<a href="http://bugs.python.org/issue1000">http://bugs.python.org/issue1000</a>'),
 
     ## emails
     ('fixed@europython.eu',