calendar_popup: Fix markup not working

This commit is contained in:
sarubo 2021-11-13 21:44:10 +09:00
parent 062ecfb6f0
commit 03e437e32a
1 changed files with 8 additions and 5 deletions

View File

@ -137,11 +137,14 @@ local function parse_cell_options(cell, args)
-- Get default
props[prop] = args[prop] or beautiful["calendar_" .. cell .. "_" .. prop] or bl_style[prop] or default
end
props['markup'] = cell == "focus" and
(args['markup'] or beautiful["calendar_" .. cell .. "_markup"] or bl_style['markup'] or
string.format('<span foreground="%s" background="%s"><b>%s</b></span>',
props['fg_color'], props['bg_color'], "%s")
if cell == "focus" and props.markup == nil then
local fg = props.fg_color and string.format('foreground="%s"', props.fg_color) or ""
local bg = props.bg_color and string.format('background="%s"', props.bg_color) or ""
props.markup = string.format(
'<span %s %s><b>%s</b></span>',
fg, bg, "%s"
)
end
return props
end
@ -420,4 +423,4 @@ end
return setmetatable(calendar_popup, calendar_popup.mt)
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80