mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 00:26:33 +00:00
Better matching for links in statuses
This commit is contained in:
parent
a60cf0ea22
commit
f87a138d49
1 changed files with 1 additions and 2 deletions
|
@ -296,8 +296,7 @@ def find_mentions(content):
|
||||||
def to_markdown(content):
|
def to_markdown(content):
|
||||||
''' catch links and convert to markdown '''
|
''' catch links and convert to markdown '''
|
||||||
content = re.sub(
|
content = re.sub(
|
||||||
r'([^(href=")])(https?:\/\/([A-Za-z\.\-_\/]+' \
|
r'([^(href=")]|^)(https?:\/\/([\w\.\-_]+\.[a-z]{2,}(\/[\w\.\-_\/]+)?))',
|
||||||
r'\.[A-Za-z]{2,}[A-Za-z\.\-_\/]+))',
|
|
||||||
r'\g<1><a href="\g<2>">\g<3></a>',
|
r'\g<1><a href="\g<2>">\g<3></a>',
|
||||||
content)
|
content)
|
||||||
content = markdown(content)
|
content = markdown(content)
|
||||||
|
|
Loading…
Reference in a new issue