html - 如何跳过 HTML 中的 <p> 标签?

标签 html css tags paragraph

我正在尝试使用 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/

相关文章:

java - Html 代码清理器

html - 如何将两个 div 对齐?

html - Bootstrap hidden-sm-down 不工作

php - 在 PHP/MySQL 中使用标签进行搜索

html - Safari/Windows 中的 CSS *仅*,可能与溢出有关

html - <li> 不显示

javascript - 使 CSS FlexBox 采用固定列宽

javascript - 点击按钮触发按钮 "under"他

MySQL 与 XML 的标记机制

java - 是否可以在资源(AKA int)上 setTag() ?