我正在尝试使用 CKeditor 作为我的博客文章的所见即所得编辑器。它工作正常,我的所有内容都可以很好地插入到数据库中。
但是我有一个问题。 CKeditor 自动插入 <p>
开头的标记,这会在从 DB 返回时弄乱我的代码。(我松散了 CSS 样式)。
因此,我想知道是否有一种方法可以告诉 HTML 忽略(跳过)那个
标记(并在最后关闭一个标记)。
谢谢...
最佳答案
您需要将配置文件 (plugin.js) 更改为:config.autoParagraph = false;
Whether automatically create wrapping blocks around inline contents inside document body, this helps to ensure the integrality of the block enter mode.
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.autoParagraph
关于html - 如何跳过 HTML 中的 <p> 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21487507/