【发布时间】:2020-05-21 11:37:16
【问题描述】:
默认情况下,TinyMCE 允许h1--h6 元素包含<strong> 元素,但这是有问题的,因为对于某些字体,标题标签的默认强权重随后会通过额外权重添加,这看起来很糟糕。
我尝试过使用valid_children 选项:
valid_children : '-h1[strong],-h2[strong],-h3[strong],-h4[strong],-h5[strong],-h6[strong]'
但是,虽然这会阻止在 h1--h6 上实现 <strong>,但它通过删除 h1-h6 元素并用 p 元素替换这些元素来解决现有情况:
<h3><strong>Subtitle goes here</strong></h3>
转换成:
<p><strong>Subtitle goes here</strong></p>
然而,期望的行为是:
<h3>Subtitle goes here</h3>
如何实现?
【问题讨论】: