mirror of
https://github.com/markqvist/Sideband.git
synced 2026-12-02 12:57:06 -05:00
Improved message markup handling
This commit is contained in:
parent
3b8700c197
commit
fbb58eb7b9
3 changed files with 15 additions and 7 deletions
|
|
@ -86,14 +86,8 @@ def multilingual_markup(data):
|
|||
if rfont != "default":
|
||||
do += "[/font]"
|
||||
|
||||
# TODO: Remove
|
||||
# print(do+"\n\n"+str(time.time()-ts))
|
||||
|
||||
return do.encode("utf-8")
|
||||
|
||||
font_map = {
|
||||
"mono": "RobotoMono-Regular"
|
||||
}
|
||||
|
||||
codepoint_map = {
|
||||
0x0590: [0x05ff, "hebrew"],
|
||||
|
|
|
|||
|
|
@ -656,7 +656,12 @@ class Messages():
|
|||
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)
|
||||
w.markup = False
|
||||
escaped_content = escape_markup(w.text)
|
||||
def deferred(dt):
|
||||
w.text = "[i]This message could not be rendered correctly, likely due to an error in its markup. Falling back to plain-text rendering.[/i]\n\n"+escaped_content
|
||||
w.markup = True
|
||||
Clock.schedule_once(deferred, 0.1)
|
||||
return x
|
||||
|
||||
Clock.schedule_once(cbf(item.ids.content_text), 0.25)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue