diff --git a/bookwyrm/outgoing.py b/bookwyrm/outgoing.py index 88377d335..f247b4283 100644 --- a/bookwyrm/outgoing.py +++ b/bookwyrm/outgoing.py @@ -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>\g<3>', content) content = markdown(content)