Tinymce 在提交时剥离属性 [英] Tinymce strips attributes on submit

查看:35
本文介绍了Tinymce 在提交时剥离属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tinymce 从所有元素中丢失了我的内联样式.我几乎什么都试过了.

<前>语言:fi",主题:高级",插件:样式、粘贴、表格、媒体、图层、全屏、自动调整大小",theme_advanced_disable : "help,sub,sup,anchor",theme_advanced_buttons1_add : "styleprops,fontselect,fontsizeselect,forecolor",theme_advanced_buttons2_add : "粘贴文本,粘贴字",theme_advanced_buttons3 : "tablecontrols,hr,removeformat,media,fullscreen",remove_linebreaks : 真,remove_trailing_nbsp : 真,relative_urls : 假,remove_script_host : 假,entity_encoding :原始",fix_nesting: 真,theme_advanced_toolbar_location : "顶部",theme_advanced_toolbar_align : "左",theme_advanced_resize_horizo​​ntal : 真,theme_advanced_resizing : 真,theme_advanced_pa​​th_location : "底部",file_browser_callback : 'myFileBrowser',valid_elements : '*[*]',inline_styles : 真

我认为没有更多的事情可以让用户做.但是还是.当我单击我的表格,打开属性,将宽度更改为 600 并查看 HTML 时,它显示 style="width: 600px".

但是,当我提交时,下一页将不会获得该样式属性.这让我很生气,我不知道该往哪里看,因为我所做的几乎任何事情都没有改变.我的语法有问题,我看不到,因为我太生气了还是什么?还有其他想法吗?

谢谢

解决方案

在特殊事件中,编辑器的内容会被写回之前的 html 元素.Tinymce 有一个内置的清理功能,它会根据你的 tinymce 设置清理你的内容(这通常发生在保存和提交上).您必须检查以下 tinymce 设置:

确保表格可以具有宽度属性.

Tinymce loses my inline styles from all elements. I've tried pretty much everything.

    language : "fi",
    theme : "advanced",
    plugins : "style,paste,table,media,layer,fullscreen,autoresize",
    theme_advanced_disable : "help,sub,sup,anchor",
    theme_advanced_buttons1_add : "styleprops,fontselect,fontsizeselect,forecolor",
    theme_advanced_buttons2_add : "pastetext,pasteword",
    theme_advanced_buttons3 : "tablecontrols,hr,removeformat,media,fullscreen",
    remove_linebreaks : true,
    remove_trailing_nbsp : true,
    relative_urls : false,
    remove_script_host : false,
    entity_encoding : "raw",
    fix_nesting: true,
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_resize_horizontal : true,
    theme_advanced_resizing : true,
    theme_advanced_path_location : "bottom",
    file_browser_callback : 'myFileBrowser',
    valid_elements : '*[*]',
    inline_styles : true

I can't think there's much more things to allow user to do. But still. When i click my table, open properties, change width to 600 and look at HTML, it says style="width: 600px".

BUT, when i submit it, next page will not get that style attribute. This is making me mad and i don't know where to look, because pretty much anything i've done, has changed nothing. Is there a problem with my syntax that i can't see, because i'm too pissed or something? Any other ideas?

Thanks

解决方案

On special events the editors content gets written back to the former html element. Tinymce has a built-in cleanup functionality which will cleanup your content depending on your tinymce settings (this usually happens onSave and onSubmit). You will have to check the following tinymce settings:

Make sure tables can have the width attribute.

这篇关于Tinymce 在提交时剥离属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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