tinymce doesn't obey extend_valid_elements
I'm trying to set up tinyMCE so that it would work with google maps iframe. TinyMCE cleanup procedure strips that if开发者_运维问答rame out.
So i found a solution here and there, that says i need to insert an extend_valid_elements : "iframe",
into tinyMCE.init.
But anyway, it will strip out my iframe. I tried adding iframe
or iframe[*]
or iframe[src|width|height|name|align]
, but it will not work. If i, however, change cleanup = false
, then it doesn't strip out iframe. But i'd rather do it the right way.
My
tinyMCE.init({
theme : "advanced",
mode : "textareas",
editor_selector : "rte",
convert_urls : false,
content_css : "<?php echo $html->url("/css/rte.css") ?>",
plugins : "table, paste, xhtmlxtras, safari",
file_browser_callback : "tinyBrowser",
theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,sub,sup,link,unlink,image,pastetext, pasteword, selectall, forecolor, backcolor,acronym,del,formatselect,fontsizeselect",
theme_advanced_buttons2 : "tablecontrols,cleanup,removeformat,code",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
paste_auto_cleanup_on_paste : true,
theme_advanced_resizing : false,
handle_event_callback: function CleanupHTML_callback(e)
{
if (e.ctrlKey && e.keyCode == 86 && e.type != "keyup")
{
setTimeout('tinyMCE.execInstanceCommand("'+e.target.editorId+'", "mceCleanup", true)',1);
//return false;
}
return true;
},
force_p_newlines : false,
force_br_newlines : true,
convert_newlines_to_brs : false,
remove_linebreaks : false,
cleanup_on_startup : false,
extend_valid_elements : "iframe[src|width|height|name|align]",
//invalid_elements : "script,onclick,ondblclick,onkeydown,onkeypress,onkeyup,onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,font",
height: "500"
});
You need to set the configuration parameter correctly using the correct name extended_valid_elements, not extend_valid_elements.
精彩评论