Customising getSemanticHTML() output #4278
Replies: 4 comments 1 reply
-
Good question. I used this code: Normal BOLD before: after:
|
Beta Was this translation helpful? Give feedback.
-
This seems to work
|
Beta Was this translation helpful? Give feedback.
-
I'd love an answer to this question as well. I need to add classes to the ul or ol generated in a list. I've been able to add custom classes to other quill elements, but the new handling of lists has broken this ability that worked in 1.x. I have the classes being applied properly in the DOM, but they're not reflected in the quill output. |
Beta Was this translation helpful? Give feedback.
-
@stashaway Maybe you can add it later after XML processing with jquery. String -> DOM -> jquery add classes -> back to string. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a Quill-powered application. But we are sharing content between the new application and an old, non-Quill, application. So storing as deltas isn't really an option, and we need to continue to persist rich text as HTML.
What I'm wondering is whether or not there is a clean way to customize the HTML produced by this method.
As a specific example, I'd like to add a CSS class to the
<pre>
generated inCodeBlockContainer.html()
(orSyntaxCodeBlockContainer.html()
). So one approach might be to inject or override this method with my own logic. Is such a thing possible?I suspect there will be other tweaking coming down the line, so I'd like to have a general solution for this sort of thing rather than a workaround for code-blocks.
Beta Was this translation helpful? Give feedback.
All reactions