Ckeditor shows extra space at the beginning and end of the p tags

你。 提交于 2019-12-10 10:08:39

问题


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?

Here is the image for what I am trying to say:


回答1:


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:

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
                    });

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



来源:https://stackoverflow.com/questions/10992094/ckeditor-shows-extra-space-at-the-beginning-and-end-of-the-p-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!