簡體   English   中英

HTML標簽使用tinyMCE剝離

[英]HTML Tags stripped using tinyMCE

最新版本的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論壇


更新

您正在設置extended_valid_elements ,但未設置valid_elements?:

valid_elements: "*[*]"

extended_valid_elements用於當前規則集。 valid_elements允許您實際創建該規則集。


舊答案

你確定它是TinyMCE做的,而不是解析服務器端請求的任何東西嗎?

如果您使用的是ASP.NET,請確保為頁面設置了ValidateRequest="False" 如果您正在使用ASP.NET MVC,那么您需要將以下內容置於控制器操作之上:

[ValidateInput(false)]

但是,請確保您至少使用白名單來保留不良內容

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM