mirror of
https://github.com/markqvist/Sideband.git
synced 2025-07-20 21:48:58 -04:00
Added detection of failed markup rendering, and plaintext fallback
This commit is contained in:
parent
ad58ab335a
commit
b2a5b8c193
2 changed files with 12 additions and 4 deletions
|
@ -653,6 +653,14 @@ class Messages():
|
|||
item.ids.content_text.owner = item
|
||||
item.ids.content_text.bind(texture_size=check_textures)
|
||||
|
||||
def cbf(w):
|
||||
def x(dt):
|
||||
if w.texture_size[0] == 0 and w.texture_size[1] == 0:
|
||||
w.text = "[i]This message could not be rendered, likely due to an error in its markup. Falling back to plain-text rendering.[/i]\n\n"+escape_markup(w.text)
|
||||
return x
|
||||
|
||||
Clock.schedule_once(cbf(item.ids.content_text), 0.25)
|
||||
|
||||
if not RNS.vendor.platformutils.is_android():
|
||||
item.radius = dp(5)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue