It seems that HTML widgets are discarded when Markdown widgets are also present. Multiple Markdown widgets get concatenated automatically, but the same behavior doesn’t apply when mixing HTML and Markdown widgets.
I’d like to see consistent behavior - ideally, HTML and Markdown widgets should both render and concatenate properly when used together.
This simple snippet demonstrates the issue: the HTML widget is not rendered if a Markdown widget is also present.
widgets = widgets or {}
function widgets.testWidget1(options)
local html = [[<span>
<p>html widget</p>
</span>
]]
return widget.new {
html = html
}
end
function widgets.testWidget2(options)
local md = "markdown widget"
return widget.new {
markdown = md
}
end
event.listen {
name = "hooks:renderTopWidgets",
run = function(e)
return widgets.testWidget1(nil)
end
}
event.listen {
name = "hooks:renderTopWidgets",
run = function(e)
return widgets.testWidget2(nil)
end
}