mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-22 16:16:39 +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):
|
||||
''' catch links and convert to markdown '''
|
||||
content = re.sub(
|
||||
r'([^(href=")])(https?:\/\/([A-Za-z\.\-_\/]+' \
|
||||
r'\.[A-Za-z]{2,}[A-Za-z\.\-_\/]+))',
|
||||
r'([^(href=")]|^)(https?:\/\/([\w\.\-_]+\.[a-z]{2,}(\/[\w\.\-_\/]+)?))',
|
||||
r'\g<1><a href="\g<2>">\g<3></a>',
|
||||
content)
|
||||
content = markdown(content)
|
||||
|
|
Loading…
Reference in a new issue