Fix bug on trailing paranthesis

This commit is contained in:
stijnvanhoey 2017-10-03 01:21:17 +02:00
parent 0a4d22fda0
commit 4aa1c072d4
1 changed files with 1 additions and 3 deletions

View File

@ -182,10 +182,8 @@ class DwcDigester(object):
def _handle_matched(inputstring):
"""quick hack version of url handling on the current prime versions data"""
url = inputstring.group()
if url.endswith("."): # not included in regex to notice the special 'end of . case'
url = url[:-1]
return "<a href=\"{}\">{}</a>".format(url, url)
regx = "(http[s]?://[\w\d:#@%/;$()~_?\+-=\\\.&]*)(?<!\))"
regx = "(http[s]?://[\w\d:#@%/;$()~_?\+-=\\\.&]*)(?<![\)\.])"
return re.sub(regx, _handle_matched, text_with_urls)
def process_terms(self):