From 02f83e46ca4333d5278ce93edd9b885ac1c2b48f Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Wed, 27 Oct 2021 11:15:11 +0200 Subject: [PATCH] uiuewhdiw --- files/routes/posts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index cc04b9416..dd52bd0b6 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -865,9 +865,13 @@ def submit_post(v): # archive other urls in post url_regex = '([^\"]+)' - print(new_post.body_html) - for url_match in re.finditer(url_regex, new_post.body_html, flags=re.M|re.I): + _body = new_post.body_html + for url_match in re.finditer(url_regex, _body, flags=re.M|re.I): href = url_match.group(1) + + if not href: + continue + print(href) title = url_match.group(2) body += f'**[{title}]({href})**:\n\n'