我在表单中使用 CKEditor。当我提交该表单时,我在 CKEditor 的文本区域中写入的内容将以这种格式保存在数据库中 [b]hello[/b][size=100]fefdf[/size]:*)
.在另一个页面中,当我检索数据时,它以 HTML 形式显示为相同的 [b]hello[/b][size=100]fefdf[/size]:*)
而不是 BBCode 格式的输出。谁能帮助我如何获取 BBcode 格式的文件?
我想要什么:
我得到了什么:
最佳答案
我推断,当您调用编辑器时,BBCode 选项已激活(请参阅 this example code ),因此这不应该是问题。
您可以尝试的一件事是设置 basicEntities配置为false。
取自 CKeditor API :
<static> {Boolean} CKEDITOR.config.basicEntities
Since: 3.0
Whether to escape basic HTML entities in the document, including:
- nbsp
- gt
- lt
- amp
Note: It should not be subject to change unless when outputting a non-HTML data format like BBCode.
Defined in: plugins/entities/plugin.js.
config.basicEntities = false;
Default Value:
true
关于php - CKEditor 输出为 BBcode 格式而不是 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8558039/