Fix room subtitle quotes: second+ quote not green
This commit is contained in:
parent
916f6d8327
commit
405573bb2d
1
TODO.md
1
TODO.md
|
@ -11,6 +11,7 @@
|
|||
- When qml syntax highlighting supports ES6 string interpolation, use that
|
||||
|
||||
- Fixes
|
||||
- 256 min width when a non-image link preview is present
|
||||
- Pressing backspace in composer sometimes doesn't work
|
||||
- Message order isn't preserved when sending a first message in a E2E
|
||||
room, then while keys are being shared sending one with another account,
|
||||
|
|
|
@ -20,10 +20,11 @@ class HtmlFilter:
|
|||
r"(?P<body>magnet:\?xt=urn:[a-z0-9]+:.+)(?P<host>)",
|
||||
]]
|
||||
|
||||
inline_quote_regex = re.compile(r"(^\s*>.*)")
|
||||
inline_quote_regex = re.compile(r"(^\s*>.*)", re.MULTILINE)
|
||||
|
||||
quote_regex = re.compile(
|
||||
r"(^|<p/?>|<br/?>|<h\d/?>)(\s*>.*?)(</?p>|<br/?>|</?h\d>|$)",
|
||||
re.MULTILINE,
|
||||
)
|
||||
|
||||
|
||||
|
@ -58,9 +59,6 @@ class HtmlFilter:
|
|||
def filter_inline(self, html: str, outgoing: bool = False) -> str:
|
||||
text = self._inline_sanitizer.sanitize(html).strip("\n")
|
||||
|
||||
if outgoing:
|
||||
return text
|
||||
|
||||
return self.inline_quote_regex.sub(
|
||||
r'<span class="quote">\1</span>', text,
|
||||
)
|
||||
|
@ -72,9 +70,7 @@ class HtmlFilter:
|
|||
if outgoing:
|
||||
return html
|
||||
|
||||
return self.quote_regex.sub(
|
||||
r'\1<span class="quote">\2</span>\3', html, re.MULTILINE,
|
||||
)
|
||||
return self.quote_regex.sub(r'\1<span class="quote">\2</span>\3', html)
|
||||
|
||||
|
||||
def sanitize_settings(self, inline: bool = False) -> dict:
|
||||
|
|
|
@ -80,7 +80,7 @@ HTileDelegate {
|
|||
) + ": " + ev.inline_content
|
||||
|
||||
return text.replace(
|
||||
/< *span +class=['"]?quote['"]? *>(.+)<\/ *span *>/,
|
||||
/< *span +class=['"]?quote['"]? *>(.+)<\/ *span *>/g,
|
||||
'<font color="' +
|
||||
theme.sidePane.room.subtitleQuote +
|
||||
'">$1</font>',
|
||||
|
|
Loading…
Reference in New Issue
Block a user