2009-06-11 128 views
4

tinyMCE的最新版本剝離了我的嵌入標籤,並在我使用它時使用javascript。我嘗試將verify_html標誌設置爲false,但沒有任何運氣。這裏是我的tinyMCE的配置js,任何人都可以看到我做錯了什麼?使用tinyMCE剝離的HTML標籤

更新:我認爲這不是服務器端問題。我用一個簡單的textarea沒有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" 
    } 
}); 
+0

再次更新。 – 2009-06-11 18:32:38

回答

3

更新#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,雖然。