In TinyMCE, how can I pre-define CSS class for unordered list <ul>
.
The idea is that I write my article in TinyMCE editor, then once the content is saved, the final HTML is:
<ul class="class_a">
...
</ul>
I'm using django-tinymce
.
In TinyMCE, how can I pre-define CSS class for unordered list <ul>
.
The idea is that I write my article in TinyMCE editor, then once the content is saved, the final HTML is:
<ul class="class_a">
...
</ul>
I'm using django-tinymce
.
The only solution seems to create a plugin, but it's very complex to keep the DOM values. So I found this alternative solution.
Style the default ul
and ol
in your CSS (put class_a
styles into them, without class applied)
Add styleselect
in your TinyMCE toolbar
Add style_formats
option to style your ul and ol like this for example:
style_formats: [ { title: 'Unstyled list', selector: 'ul,ol', classes: 'list-none' } ]
` without exception, or do you want this to be the default *option*, but allow for other markup?
– Tiny Lincoln Jun 03 '21 at 22:42without exception is fine for me at this point...
– PG04 Jun 06 '21 at 13:56