I need to allow span tag with class in the trix editor.
I could achive adding span tag by
Trix.config.textAttributes.span = {
tagName: "span",
inheritable: true
};
But I can't get class on span it is still getting stripped by the Trix.HTMLSanitizer I guess.
I also tried with
Trix.config.textAttributes.span = {
tagName: "span",
inheritable: true,
parser: false
};
//and
Trix.config.textAttributes.span = {
tagName: "span",
inheritable: true,
parser: (element) => {
element.allowedAttributes = 'class';
}
};
Can't figure out how to override the Trix.HTMLSanitizer to allow something like <span class="my-class">value</span> to show up styled in the editor.