textbox.set_markup: handle `parsed.message` from Pango.parse_markup
Ref: https://github.com/pavouk/lgi/issues/115 Fixes: https://github.com/awesomeWM/awesome/issues/301
This commit is contained in:
parent
5c446c9c09
commit
5b60bc212a
|
@ -63,8 +63,8 @@ function textbox:set_markup(text)
|
|||
end
|
||||
|
||||
local attr, parsed = Pango.parse_markup(text, -1, 0)
|
||||
-- In case of error, attr is false and parsed is an error message
|
||||
if not attr then error(parsed) end
|
||||
-- In case of error, attr is false and parsed is a GLib.Error instance.
|
||||
if not attr then error(parsed.message or tostring(parsed)) end
|
||||
|
||||
self._markup = text
|
||||
self._layout.text = parsed
|
||||
|
|
Loading…
Reference in New Issue