ckeditor bug 嵌套 div bug 的解决方法?
对于此错误有什么建议或解决方法吗?
http://dev.ckeditor.com/ticket/6436
我真的需要解决这个错误,因为我需要在 CKEditor 的编辑器区域中用一个退格键删除整个 div。但在插入时,div 由于错误而被嵌套。因此,删除单个 div 变得不可能。
Any suggestions or workarounds for this bug?
http://dev.ckeditor.com/ticket/6436
i really need to get around this bug as i need to delete whole divs with one backspace in the editor area in CKEditor. but on insertion the divs get nested due to the bug. So, deletion of individual divs become impossible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我最终设计的解决方法——
http://thecamelcase.com/2011/06/reining-在ckeditor中的光标中/
Here is the workaround i finally designed--
http://thecamelcase.com/2011/06/reining-in-the-cursor-in-ckeditor/
我遇到了同样的问题,不幸的是,由 GhostCoder 进行的修复的链接不再可用。
除了嵌套 div 问题之外,我们还强制粘贴为纯文本(因此数据将粘贴为纯文本,除非使用“从单词粘贴”),并且我们使用 div 作为输入模式。在粘贴的数据中,换行符替换为
标签,而我们希望每一行都是元素内的包装器。
这就是我最终解决问题的方法。您应该知道我们没有更改 autoParagraph 配置选项,因此它默认为 true,我不建议在配置级别禁用它。我将尝试很好地对这个解决方案进行代码注释,以便您很好地了解这里实际做了什么。
I encountered this same issue and unfortunately the link to the fix made by ghostCoder isn't available anymore.
In addition to nested divs issue, we have forced paste as plain text (so data is pasted as plain text unless "paste from word" is used) and we are using div as our enterMode. In the pasted data line breaks were replaced with <br /> tags whereas we wanted each line to be wrapper inside element.
This our how I eventually solved the issue. You should know that we have not changed autoParagraph config option so it defaults to true and I don't recommend disabling it in config level. I'll try to code comment this solution well so that you get a good idea what is actually done here.