diff --git a/TODO.md b/TODO.md index fc92bc53..d1a959a7 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ ## Before release +- Atomic - Catch server 5xx errors when sending message and retry - Update README.md diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py index 9320b459..e690c2fc 100644 --- a/src/backend/html_markdown.py +++ b/src/backend/html_markdown.py @@ -120,7 +120,9 @@ class HTMLProcessor: inline_quote_regex = re.compile(r"(^|⏎)(\s*>[^⏎\n]*)", re.MULTILINE) quote_regex = re.compile( - r"(^|
| |
|
|?h\d>|$)",
+ r"(^||
|
|?h\d>|$)",
re.MULTILINE,
)
@@ -178,12 +180,16 @@ class HTMLProcessor:
return html
# Client-side modifications
- if inline:
- return self.inline_quote_regex.sub(
- r'\1\2', html,
- )
- return self.quote_regex.sub(r'\1\2\3', html)
+ html = self.quote_regex.sub(r'\1\2\3', html)
+
+ if not inline:
+ return html
+
+ return self.inline_quote_regex.sub(
+ r'\1\2', html,
+ )
+
def sanitize_settings(