HTML标签使用tinyMCE剥离 [英] HTML Tags stripped using tinyMCE

查看:182
本文介绍了HTML标签使用tinyMCE剥离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Latest version of tinyMCE is stripping my embed tags, and javascript when I use it. I tried setting the verify_html flag to false without any luck. Here is my config js for tinyMCE, can anyone see what I am doing wrong?

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

Update: I am positive it is not a server side issue. I used a plain textarea without tinymce loaded and it worked perfectly. It is tinyMCE doing the stripping.

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

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

After doing some more digging, you ought to try the following.

设置:

media_strict: false

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

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

来源( MoxieCode论坛

更新

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

You're setting extended_valid_elements, but not setting valid_elements?:

valid_elements: "*[*]"

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

extended_valid_elements is used for the current ruleset. But valid_elements allows you to actually create that ruleset.

旧答案

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

Are you sure it's TinyMCE doing it, and not whatever is parsing the server-side request?

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

If you're using ASP.NET, make sure ValidateRequest="False" is set for the page. If you're using ASP.NET MVC, then you'll need to put the following above the controller action:

[ValidateInput(false)]

确保你至少使用白名单,以防止坏事

这篇关于HTML标签使用tinyMCE剥离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆