Is there a way to insert small text (i. e. text within <small></small> elements) in a writer field? HTML entered in that field appears to be converted to plain text and there doesn’t seem to be any Markdown syntax for this.
In Kirby 4 you can add custom marks/nodes to the writer field: Writer marks/nodes | Kirby CMS
Yeah, but I’m using Kirby 3 for reasons. But it turns out I need a more complex set-up because there can be multiple paragraphs of small text, so I’m probably going to create a custom block for that.
Hi,
In Kirby 5, I tried to add a small node too using the quote example of the documentation like this:
window.panel.plugin("guigui/customnodes", {
writerNodes: {
small: {
get button() {
return {
icon: "text",
label: "Texte réduit"
};
},
commands({ type, utils }) {
return () => utils.toggleWrap(type);
},
get name() {
return "small";
},
get schema() {
return {
content: "block+",
group: "block",
defining: true,
draggable: false,
parseDOM: [
{
tag: "small"
}
],
toDOM: () => ["small", 0]
};
}
}
}
});
But the small is not save, and a break is created when saving :
<small><p><br class="ProseMirror-trailingBreak"></p></small>
What did I miss?
Thanks!
IMO, small is an inline element, not a block element and hence a mark not a node.