I’m trying to figure out how to have some custom HTML added to a plugin setting and then display that HTML safely in a widget.
My widget code is the following:
import { createWidget } from 'discourse/widgets/widget';
import { h } from 'virtual-dom';
createWidget('sidebar-custom-content', {
tagName: 'div.sidebar-custom-content',
html(attrs) {
return h('div', Discourse.SiteSettings.sidebar_custom_content);
},
});
and the plugin settings.yml has this:
sidebar_custom_content:
type: text
default: ''
client: true
As it is, if I enter HTML in the setting field, it gets output as regular text.