【问题标题】:Prevent wp_editor to alter initial content防止 wp_editor 更改初始内容
【发布时间】:2013-08-02 18:29:01
【问题描述】:

我正在尝试加载一个完整的 HTML 页面(包括 doctype、head 和 style 部分)

当我切换到可视化 tinyMCE 时,会删除所有“无效”标签,如正文标签、元标签等。

它甚至将title标签包装成p标签

如何防止这种情况发生?

这就是我插入 wp_editor 的方式:

wp_editor('', 'my-editor', array('wpautop' => false, 'media_buttons' => false, 'textarea_rows' => 88,'teeny' => true, 'quicktags' => true) ); 

【问题讨论】:

    标签: wordpress tinymce rich-text-editor


    【解决方案1】:

    这是因为大多数 rte 编辑器使用 contenteditable iframe 并且内容进入正文。没有浏览器会允许这样做,因为它不是有效的 html。然后被浏览器踢出。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-11
      • 2015-02-18
      • 1970-01-01
      • 2014-04-02
      • 1970-01-01
      • 2017-04-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多