添加< p>时删除不需要的换行符在CKEditor中 [英] Removing unwanted newline characters when adding <p> in CKEditor

查看:570
本文介绍了添加< p>时删除不需要的换行符在CKEditor中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CKEditor中加载一组段落的内容时,它会将< p> 标签替换为< p>&#x9 ;

When loading content with a set of paragraphs in CKEditor, it replaces my <p> tags with <p>&#x9;

这意味着编辑器转换:

<p>paragraph 1</p>
<p>paragraph 2</p>
<p>paragraph 3</p>

到这样的结果:

<p>
   paragraph 1</p>
<p>
   paragraph 2</p>
<p>
   paragraph 3</p>

如何修复它,使CKEditor不会在看到段落时添加额外的换行符标签?

How do I fix it so that CKEditor doesn't add the extra newline characters when it sees the paragraph tags?

推荐答案

将此行添加到ckeditor.js配置文件中:

Add this line to the ckeditor.js configuration file:

n.setRules('p',{indent:false,breakAfterOpen:false});

有关HTML Writer格式化的更多信息,请参见开发人员指南:输出格式在CKSource文档。

More about the formatting of the HTML Writer can be found in Developers Guide: Output Formatting at CKSource Docs.

这篇关于添加&lt; p&gt;时删除不需要的换行符在CKEditor中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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