From e26ba3857c381efa334ca0030aa7845a2a79d3e6 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 23 May 2022 16:13:56 -0700 Subject: [PATCH] Only modify pound symbols at the start of a word --- bookwyrm/views/status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/views/status.py b/bookwyrm/views/status.py index cd13af527..a331413c4 100644 --- a/bookwyrm/views/status.py +++ b/bookwyrm/views/status.py @@ -260,7 +260,7 @@ def _wrapped(text): def to_markdown(content): """catch links and convert to markdown""" content = format_links(content) - content = content.replace("#", "\\#") + content = re.sub(r"\B#", "\\#", content) content = markdown(content) # sanitize resulting html sanitizer = InputHtmlParser()