naughty.widget: xml_escape message and title text
fixes empty notifications when special characters like '&' are used
This commit is contained in:
parent
382635a94a
commit
6934efdd32
|
@ -16,12 +16,13 @@
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
local textbox = require("wibox.widget.textbox")
|
local textbox = require("wibox.widget.textbox")
|
||||||
local gtable = require("gears.table")
|
local gtable = require("gears.table")
|
||||||
|
local gstring = require("gears.string")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
local message = {}
|
local message = {}
|
||||||
|
|
||||||
local function markup(notif, wdg)
|
local function markup(notif, wdg)
|
||||||
local ret = notif.message or ""
|
local ret = gstring.xml_escape(notif.message) or ""
|
||||||
local fg = notif.fg or beautiful.notification_fg
|
local fg = notif.fg or beautiful.notification_fg
|
||||||
|
|
||||||
wdg:set_font(notif.font or beautiful.notification_font)
|
wdg:set_font(notif.font or beautiful.notification_font)
|
||||||
|
|
|
@ -16,12 +16,13 @@
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
local textbox = require("wibox.widget.textbox")
|
local textbox = require("wibox.widget.textbox")
|
||||||
local gtable = require("gears.table")
|
local gtable = require("gears.table")
|
||||||
|
local gstring = require("gears.string")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
local title = {}
|
local title = {}
|
||||||
|
|
||||||
local function markup(notif, wdg)
|
local function markup(notif, wdg)
|
||||||
local ret = "<b>"..(notif.title or "").."</b>"
|
local ret = "<b>"..(gstring.xml_escape(notif.title) or "").."</b>"
|
||||||
local fg = notif.fg or beautiful.notification_fg
|
local fg = notif.fg or beautiful.notification_fg
|
||||||
|
|
||||||
wdg:set_font(notif.font or beautiful.notification_font)
|
wdg:set_font(notif.font or beautiful.notification_font)
|
||||||
|
|
Loading…
Reference in New Issue