Ckeditor在p标签的开头和结尾显示额外的空间 [英] Ckeditor shows extra space at the beginning and end of the p tags

查看:374
本文介绍了Ckeditor在p标签的开头和结尾显示额外的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ckeditor作为我的小型网络项目,但是当我编辑内容或创建新的内容时,它会在打开p标签和文本后自动添加空格,当我删除空间并保存内容时工作,但是当我再次编辑,它再次添​​加空间,如何删除它。我认为打开p标签和文本之间的空间不要紧,但它显示空间,而我从数据库中检索这些内容,它搞砸了我的设计。如何解决这个问题?

I am using ckeditor for my small web project, but when I edit a content or create a new content, it automatically add white space after the opening of p tag and the text, when I remove the space and save the content it works but when I edit again, it add the space again, how do I remove it. I think the space between opening of p tag and the text should not matter, but it shows spaces while I retrieve those content from database and it mess up with my design. How do I solve this?

这是我想说的图片:

推荐答案

我认为这只是一个设置:这是一个古老的资源,但我认为它仍然适用,根据你使用的版本可能:

I think it's just a setting: This is from an oldish resource, but I think it still applies, depending on the version you are using probably:

似乎设置为打开 p 标签添加休息和缩进(您的问题)):

There seem to be settings for adding breaks and indents (your problem I guess) for opening a p tag:

this.dataProcessor.writer.setRules( 'p',
                    {
                        indent : false,
                        breakBeforeOpen : true,
                        breakAfterOpen : false,
                        breakBeforeClose : false,
                        breakAfterClose : true
                    });

资料来源: http://cksource.com/forums/viewtopic.php?t=18067 (但有很多其他提到这个问题,可以在谷歌上找到)

Source : http://cksource.com/forums/viewtopic.php?t=18067 (but there are quite some other mentions of this problem to be found on google)

这篇关于Ckeditor在p标签的开头和结尾显示额外的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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