views:

1360

answers:

2

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?

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"
    }
});
+1  A: 

Update #2:

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

Set:

media_strict: false

And set the settings for the <embed> tag:

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

Source (MoxieCode Forum)


Update:

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

valid_elements: *[*]

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

Old Answer:


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

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)]

Make sure you're at least using a whitelist to keep bad stuff out, though.

George Stocker
That is definately not it, see update above.
Al Katawazi
Updated. I think I found your issue.
George Stocker
sorry still a miss
Al Katawazi
Can you update your post with your updated tiny_mce init?
George Stocker
the post should be updated
Al Katawazi
Updated again .
George Stocker
Thanks got to work now!
Al Katawazi
A: 

Try adding:

cleanup : false,

See here

StriplingWarrior
this does not seem to work either
Al Katawazi