我如何自定义tinymce修复损坏的html的方式?特别列出?
我有像这样创建html的最终用户:
<ol>
<li>some text</li>
<li>some more text</li>
<div>a div in the wrong spot</div>
<li>the last line of text</li>
</ol>
Tinymce将其变成这样的东西:
<ol>
<li>some text</li>
<li>some more text</li>
</ol>
<div>a div in the wrong spot</div>
<ol>
<li>the last line of text</li>
</ol>
这是一个问题,因为有时它会重新启动编号,有时它不会重新启动编号(start =“3”),但格式始终是搞砸了。
如何强制tinymce将
附加到之前的
内部?我尝试将 fix_list_elements 设置为 false,但这没有帮助。
I have end-users who created html like this:
<ol>
<li>some text</li>
<li>some more text</li>
<div>a div in the wrong spot</div>
<li>the last line of text</li>
</ol>
Tinymce turns it into something like this:
<ol>
<li>some text</li>
<li>some more text</li>
</ol>
<div>a div in the wrong spot</div>
<ol>
<li>the last line of text</li>
</ol>
This is a problem because sometimes it restarts the numbering, and sometimes it doesn't restart numbering (start="3") but the formatting is always messed up.
How can I force tinymce to append the <div>
inside of the previous <li>
?
I've tried setting fix_list_elements to false, but this doesn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仍然没有找到确切的答案,但有足够的解决方法。使用
valid_children
TinyMCE 选项。这允许细粒度地让无效 HTML 保持不固定状态。
Still have not found an exact answer, but there is a sufficient workaround. Using the
valid_children
TinyMCE option.This allows for granularity in letting invalid HTML remain unfixed.