Work around parens in the url regex

This commit is contained in:
Mouse Reeve
2021-01-10 08:39:30 -08:00
parent a1e8d5c7c2
commit 1e42622b8e
2 changed files with 4 additions and 1 deletions

View File

@ -296,7 +296,7 @@ def find_mentions(content):
def format_links(content):
''' detect and format links '''
return re.sub(
r'([^(href=")]|^)(https?:\/\/(%s([\w\.\-_\/+&\?=:;,])*))' % \
r'([^(href=")]|^|\()(https?:\/\/(%s([\w\.\-_\/+&\?=:;,])*))' % \
regex.domain,
r'\g<1><a href="\g<2>">\g<3></a>',
content)