RGJ
(Richard - Communiteq)
August 3, 2020, 10:05am
1
I vaguely remember that there was a way - using a site setting or a plugin - to add entries to the whitelist of allowed HTML tags and attributes (https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/addon/white-lister.js ).
I’m not very familiar with the internals of this part of Discourse. Does anyone have some pointers on how to add to this list using a plugin or maybe even site settings?
2 Likes
Is this what you are after?
/*eslint no-bitwise:0 */
const rule = {
tag: "policy",
wrap: function (token, info) {
if (!info.attrs.group && !info.attrs.groups) {
return false;
}
token.attrs = [["class", "policy"]];
if (info.attrs["group"]) {
token.attrs.push(["data-group", info.attrs.group]);
}
if (info.attrs["groups"]) {
token.attrs.push(["data-groups", info.attrs.groups]);
}
This file has been truncated. show original
5 Likes
RGJ
(Richard - Communiteq)
August 3, 2020, 1:53pm
6
Yes!!! Thank you @joffreyjaffeux
1 Like