Fix quotes in room subtitles
This commit is contained in:
parent
630e011cfd
commit
9d3e2dbfc4
1
TODO.md
1
TODO.md
|
@ -2,6 +2,7 @@
|
|||
|
||||
## Before release
|
||||
|
||||
- Atomic
|
||||
- Catch server 5xx errors when sending message and retry
|
||||
- Update README.md
|
||||
|
||||
|
|
|
@ -120,7 +120,9 @@ class HTMLProcessor:
|
|||
inline_quote_regex = re.compile(r"(^|⏎)(\s*>[^⏎\n]*)", re.MULTILINE)
|
||||
|
||||
quote_regex = re.compile(
|
||||
r"(^|<p/?>|<br/?>|<h\d/?>)(\s*>.*?)(</?p>|<br/?>|</?h\d>|$)",
|
||||
r"(^|<span/?>|<p/?>|<br/?>|<h\d/?>)"
|
||||
r"(\s*>.*?)"
|
||||
r"(<span/?>|</?p>|<br/?>|</?h\d>|$)",
|
||||
re.MULTILINE,
|
||||
)
|
||||
|
||||
|
@ -178,12 +180,16 @@ class HTMLProcessor:
|
|||
return html
|
||||
|
||||
# Client-side modifications
|
||||
if inline:
|
||||
|
||||
html = self.quote_regex.sub(r'\1<span class="quote">\2</span>\3', html)
|
||||
|
||||
if not inline:
|
||||
return html
|
||||
|
||||
return self.inline_quote_regex.sub(
|
||||
r'\1<span class="quote">\2</span>', html,
|
||||
)
|
||||
|
||||
return self.quote_regex.sub(r'\1<span class="quote">\2</span>\3', html)
|
||||
|
||||
|
||||
def sanitize_settings(
|
||||
|
|
Loading…
Reference in New Issue
Block a user