【问题标题】:How to stop TinyMCE removing <p> inside <td>如何停止 TinyMCE 删除 <td> 中的 <p>
【发布时间】:2014-12-21 19:16:59
【问题描述】:

我目前正在从客户的 CMS 安装中删除 html 的 TinyMCE (v=3.5.8)。在旧版本中有 cleanup:false 和 cleanup_on_startup 但 3.4+ 已弃用。但是,我很难解决这种行为。首先是它弄乱的代码:

之前:

<td><p align="center">
  <strong><span style="color: #336600; font-family: georgia,times new roman,times,serif; font-size: x-large;">
    Text<br>Text<br>Text<br>Text
  </span></strong>
</p></td>

点击进入表格单元格后

<td>
  <strong><span style="color: #336600; font-family: georgia,times new roman,times,serif; font-size: x-large;">
    Text<br>Text<br>Text<br>Text
  </span></strong>
</td>

所以问题是,为什么下面的 init-params 不停止这种行为?

// Skin options
skin : "o2k7",
skin_variant : "silver",

// custom params from attribute tinyparams
verify_html:false, 
fix_table_elements:false,
schema:"html4",
valid_children: "+body[style],+td[p],+tr[p],+th[p],+tbody[p],+table[p]"

据我了解,删除我的段落标签的是验证子规则的过程。我还使用了带有完整 xhtml 规则集的 valid_elements http://www.tinymce.com/wiki.php/Configuration3x:valid_elements

有人知道这里发生了什么吗?如有任何提示,我将不胜感激。

【问题讨论】:

    标签: tinymce wysiwyg tinymce-4


    【解决方案1】:

    设置以下选项,使其不会检查您的 HTML 是否有错误。

    verify_html : false
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-06
      • 1970-01-01
      相关资源
      最近更新 更多