我正在尝试在TinyMCE包装的文本字段中插入一个简单的图像链接,但它正在剥离我的标记的所有。我的标记看起来像:
<a class="video-launcher lightbox-video-launcher" href="http://www.youtube.com/watch?v=blah" ><span class="video-launcher-bg"></span><span class="video-launcher-button"></span></a>
我的tinymce_config_url_init.html看起来像是:
{
"theme_advanced_toolbar_align":"left",
"content_css":"/media/css/cms_tinymce.css,/media/css/cms_tinymce_admin.css",
"theme_advanced_blockformats":"p,h2,h3,div,customformat",
"theme_advanced_statusbar_location":"bottom",
"theme_advanced_path":false,
"plugins":"fullscreen,paste",
"valid_elements":"*[*]",
"media_strict":false,
"paste_auto_cleanup_on_paste":true,
"theme_advanced_styles":"Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
"width":"680",
"theme":"advanced",
"theme_advanced_font_sizes":"8px,10px,12px,14px,16px,18px,20px,24px,36px",
"theme_advanced_resizing":true,
"height":"300",
"relative_urls":false,
"theme_advanced_toolbar_location":"top",
"inline_styles":true,
"language":"en",
"theme_advanced_buttons1":"fullscreen,|,undo,redo,|,bullist,numlist,|,anchor,link,unlink,charmap,|,code,|,justifyleft,justifycenter,justifyright,|,image,",
"theme_advanced_buttons3":"",
"theme_advanced_buttons2":"removeformat,styleselect,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,|,forecolor,backcolor",
"removeformat_selector":"span,div,p,h1,h2,h3"
}
我知道问题出在TinyMCE上,因为没有提交表单,只是再次单击“html”按钮,TinyMCE的弹出窗口没有显示任何内容。
我假设TinyMCE正在删除任何它认为看起来不安全或无效的东西。对于我的应用程序,它正在管理部分中使用,因此内容可以信任。如何禁用TinyMCE配置导致此标记被删除?
答案 0 :(得分:0)
将您网站的css样式表添加到"content_css"
变量,或许?
并且还将"paste_auto_cleanup_on_paste"
设置为false,而不是true。
答案 1 :(得分:0)
您应该仔细查看tinymce配置参数valid_elements.您需要根据需要进行设置并定义有效的元素和属性。