简体   繁体   English

jwysiwyg:在添加新段落时不克隆某些属性吗?

[英]jwysiwyg: Don't clone certain attributes when appending a new paragraph?

When adding a new paragraph by hitting enter in jwysiwyg, the new paragraph automatically has the previous paragraph's attributes assigned to it. 通过在jwysiwyg中按Enter添加新段落时,新段落将自动为其分配前一段落的属性。

Is there a way to disallow the cloning of certain attributes into newly inserted elements? 有没有办法禁止将某些属性克隆到新插入的元素中? I looked in the source of jwysiwyg but am not having much luck finding where the elements get cloned. 我查看了jwysiwyg的来源,但没有太多运气找到要克隆的元素的位置。

I ended up using CKeditor instead. 我最终改为使用CKeditor。 It's definitely bigger, probably more than I need, but it provided some other things we needed for this project as well. 它肯定更大,可能超出了我的需求,但是它还提供了该项目需要的其他一些功能。

However, I had the same problem in CKeditor. 但是,我在CKeditor中遇到了同样的问题。 All attributes except id were cloned, including my custom attribute. 除了id以外的所有属性都已克隆,包括我的自定义属性。

In CK, I was able to circumvent this by adding node.removeAttribute( 'myattrib', false ); 在CK中,我可以通过添加node.removeAttribute( 'myattrib', false );来规避此问题node.removeAttribute( 'myattrib', false ); at line 117 of /ckeditor/_source/core/dom/node.js /ckeditor/_source/core/dom/node.js第117 /ckeditor/_source/core/dom/node.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM