4

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

更新:我很肯定这不是服务器端问题。我使用了一个没有加载tinymce的纯文本区域,它工作得很好。剥离的是 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"
    }
});
4

1 回答 1

3

更新#2

在进行更多挖掘之后,您应该尝试以下操作。

放:

media_strict: false

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

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

来源(MoxieCode 论坛


更新

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

valid_elements: "*[*]"

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


旧答案

您确定是 TinyMCE 在做,而不是在解析服务器端请求吗?

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

[ValidateInput(false)]

不过,请确保您至少使用白名单来阻止坏东西

于 2009-06-11T16:36:44.247 回答