tinymce - < 并将引号更改为 tinyMCE 中的 HTML 实体

标签 tinymce

在DB中,如下。

<img src="../../../../assets/images/frontpage/big_tree.jpg" alt="" 
width="516" height="200" />

但是当在tinyMCE中时,所有的<、>和"都变成这样的html实体。 所以在FF中不显示。

&lt;img src=&quot;../../../../assets/images/frontpage/big_tree.jpg&quot; 
alt=&quot;&quot; width=&quot;516&quot; height=&quot;200&quot; /&gt;

如何避免这个问题?

我有以下tinyMCE init

tinyMCE.init({
        mode : "textareas",
        /* // if I want to add to a specific area then use this
        mode : "specific_textareas",
        editor_selector : "mceEditor", // add class="mceEditor" where you want to add tinyMCE
        */

        theme : "advanced",
        plugins : "advimage,advlink,media,contextmenu",
        //theme_advanced_buttons1_add_before : "newdocument,separator",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
        theme_advanced_buttons2_add_before: "cut,copy,separator,",
        theme_advanced_buttons3_add_before : "",
        theme_advanced_buttons3_add : "media",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        //extended_valid_elements : "hr[class|width|size|noshade]",
        extended_valid_elements : "span[class|align|style]",
        file_browser_callback : "ajaxfilemanager",
        paste_use_dialog : false,
        theme_advanced_resizing : true,
        theme_advanced_resize_horizontal : true,
        apply_source_formatting : true,
        force_br_newlines : true,
        force_p_newlines : false,   
        relative_urls : true
    });

提前致谢。

最佳答案

在 php 中你可以使用 html_entity_decode .

关于tinymce - < 并将引号更改为 tinyMCE 中的 HTML 实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10152840/

相关文章:

javascript - 如何从tinyMCE禁用HTML标签

wordpress - 防止 TinyMCE 在 Wordpress 上的 p 标签中包装文本

html - 无法将 html 与 angularJS 和 tinymce 绑定(bind)

javascript - 如何动态替换TinyMCE中的内容?

javascript - Safari 和 Chrome 上的 Tinymce 换行问题

javascript - tinyMCE 在 IE8 中丢帧

集成 django-tinymce 和 django-filebrowser 时出现 Javascript 错误

javascript - 如何将大量Javascript文件注入(inject)CHROME EXTENSION?

ruby-on-rails - 如何更改 TinyMCE ruby​​ 插件的格式下拉框?

wordpress - TinyMCE 可视化编辑器超链接按钮在 WordPress 3.5 中不起作用