Closed pl-mnm closed 4 months ago
Unfortunately, you can only use this mechanism to alter styles of text, and it doesn't support customising other nodes like this. That's because under the hood we use the textStyle
mark to modify text.
More the to the point, it's currently not possible to modify the schema of nodes in this fashion. I assume you want to be able to add a class to the <ul>
elements in the editor? At the moment, you can't store any attributes on elements that we don't specifically allow. This is how ProseMirror's schema works, and is very restrictive.
The reason this works for paragraphs and text, is through the textStyle
mark, which is an additional bit of content stored alongside other nodes. That's not possible for the list nodes.
It's also not possible to target multiple types with this format.
I'll have to look at some options here to make things more flexible, but for the moment, you're really stuck with creating your own nodes.
Gotcha, thanks for the explanation.
Am interested in this too, specifically showing custom list style in the editor and being able to add them / remove them.
Question
I'd like to create custom formatting for a bullet list, and have the following in my
Default.json
config:This however is not working, but I'm not sure if I go it wrong or if there's a bug.
I'd also like to know if it's possible to target multiple
types
with a single format. Eg."type": ["bulletList", "paragraph"]
. Thanks in advanceCraft 4.6.1, Vizy 2.1.15
Additional context
No response