javascript – 使用tinyMCE剥离的HTML标签

最新版本的tinyMCE正在剥离我的嵌入标签,并在我使用它时使用javascript.我尝试将verify_html标志设置为false而没有任何运气.这是我的tinyMCE的配置js,谁能看到我做错了什么?

更新:我很肯定这不是服务器方面的问题.我使用了没有装载tinymce的普通textarea,它工作得很好.它是tinyMCE进行剥离.

tinyMCE.init({
    // General options
    mode: "textareas",
    theme: "advanced",
    plugins:
safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,
insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,
fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
    valid_elements: "*[*]",
    verify_html : false,


    // Theme options
    theme_advanced_buttons1:     
    bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,
justifyfull,|,formatselect,fontselect,fontsizeselect|,ltr,rtl,|,fullscreen|,forecolor,
backcolor,code",
    theme_advanced_buttons2: 
    "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,
outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,advhr",
    theme_advanced_buttons3: 
"tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media",
    theme_advanced_toolbar_location: "top",
    theme_advanced_toolbar_align: "left",
    theme_advanced_statusbar_location: "bottom",
    theme_advanced_resizing: true,
    height: "500px",

    // Example word content CSS (should be your site CSS) this one removes paragraph
   // margins
    content_css: "content/word.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url: "lists/template_list.js",
    external_link_list_url: "lists/link_list.js",
    external_image_list_url: "lists/image_list.js",
    media_external_list_url: "lists/media_list.js",

    // Replace values for the template plugin
    template_replace_values: {
        username: "Some User",
        staffid: "991234"
    }
});

解决方法:

更新#2:

在做了一些挖掘之后,你应该尝试以下方法.

组:

media_strict: false

并设置< embed>的设置标签:

+'embed[width|height|name|flashvars|src|bgcolor|align|play|loop|quality|allowscriptaccess|type|pluginspage]'

来源(MoxieCode Forum)

更新:

您正在设置extended_valid_elements,但没有设置valid_elements?:

valid_elements: "*[*]"

extended_valid_elements用于当前规则集.但valid_elements允许您实际创建该规则集.

旧答案:

你确定它是TinyMCE做的,而不是解析服务器端请求的任何东西吗?

如果您使用的是ASP.NET,请确保为页面设置了ValidateRequest =“False”.如果您正在使用ASP.NET MVC,那么您需要将以下内容置于控制器操作之上:

[ValidateInput(false)]

但请确保您至少使用的是whitelist to keep bad stuff out.

上一篇:javascript – tinymce使用文件浏览器添加图像[暂停]


下一篇:javascript – 如何在TinyMCE中允许自我结束标记?