Fix reply starting with a >quote not being colored

For a message that was a reply to another, and that that started with
a "> ..." quote, the quote wasn't getting highlighted due to regex not
accounting for cases where one is preceded by a </mx-reply> closing tag.
This commit is contained in:
miruka 2021-04-09 04:42:25 -04:00
parent c4eef71a83
commit 59ef2004e1

View File

@ -183,9 +183,9 @@ class HTMLProcessor:
inline_quote_regex = re.compile(r"(^|⏎|>)(\s*&gt;[^⏎\n]*)", re.MULTILINE) inline_quote_regex = re.compile(r"(^|⏎|>)(\s*&gt;[^⏎\n]*)", re.MULTILINE)
quote_regex = re.compile( quote_regex = re.compile(
r"(^|<span/?>|<p/?>|<br/?>|<h\d/?>)" r"(^|<span/?>|<p/?>|<br/?>|<h\d/?>|<mx-reply/?>)"
r"(\s*&gt;.*?)" r"(\s*&gt;.*?)"
r"(<span/?>|</?p>|<br/?>|</?h\d>|$)", r"(<span/?>|</?p>|<br/?>|</?h\d>|</mx-reply/?>|$)",
re.MULTILINE, re.MULTILINE,
) )