Is there a way to get tinymce to generate valid html? It's generating lists like this:
<li>text</li>
<li>text</li>
<li>text</li>
<ul>
<li>text</li>
<li>text</li>
<li>text</li>
<ul>
<li>text</li>
<ul>
<li>text</li>
</ul>
</ul>
</ul>
</ul>
Unicorn outputs:
Element ul not allowed as child of element ul in this context.
I'd prefer lists like this:
<ul>
<li>text</li>
<li>text</li>
<li>
text
<ul>
<li>text</li>
<li>text</li>
<li>
text
<ul>
<li>text</li>
</ul>
</li>
</ul>
</li>
</ul>
I was happy to find that this question solved the issue (setting source_formatting
to false
when initializing tinymce); however it seems when tinymce parses some markup (for example if you put some in a textarea and then initilize tinymce) tinymce re-parses it as in example 1. Any ideas on how to make tinymce not change the markup originally in the editor I initialize it on?