vizy icon indicating copy to clipboard operation
vizy copied to clipboard

Allow to add markup in HTML mode

Open peerfischer opened this issue 10 months ago • 1 comments

What are you trying to do?

I try to add a custom CSS class to a H2 tag

What's your proposed solution?

allow custom markup if HTML mode ist enabled in config

Additional context

No response

peerfischer avatar Apr 26 '24 08:04 peerfischer

This is by design with ProseMirror and its schema. You can't just add arbitrary HTML and have it save against a node. So while you can edit the raw HTML of the field, it won't necessarily save everything as you input it. This is to ensure that the HTML can be effectively represented as blocks of content (JSON).

This is true for HTML elements (the tags) and the attributes on the tag. We would need to modify the default Heading tag to allow for any additional attributes we want to support.

See https://github.com/verbb/vizy/issues/255

We need to look at ways to force-save node attributes in some fashion, but it's going against both Tiptap and ProseMirror.

engram-design avatar Apr 28 '24 01:04 engram-design