Turn off enclosing lt;pgt; tags in CKEditor 3.0(关闭封闭 lt;pgt;CKEditor 3.0 中的标签)
问题描述
是否有可能关闭所有书面内容的自动封闭在<p></p>在 CKEditor 3.x 中?
Is there a possibility to turn off the automatic enclosing of all written content within <p></p> in CKEditor 3.x?
我试过了
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
但这只是将内联换行符更改为 <br/>同时离开封闭的段落.
but this just changes the inline linebreaks to <br /> while leaving the enclosing paragraph.
当前编写测试"会产生此输出
Currently writing "Test" produces this output
<p>
Test</p>
但我希望它是简单的
Test
是否有为此的配置属性,或者是否有其他内联编辑器更适合此?
Is there a configuration property for this or would another inline editor to be better suited for this?
推荐答案
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
- 这对我来说非常适合.您是否尝试过清除浏览器缓存 - 这有时是个问题.
您也可以使用 jQuery 适配器查看它:
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
- this works perfectly for me.
Have you tried clearing your browser cache - this is an issue sometimes.
You can also check it out with the jQuery adapter:
<script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/js/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$(function() {
$('#your_textarea').ckeditor({
toolbar: 'Full',
enterMode : CKEDITOR.ENTER_BR,
shiftEnterMode: CKEDITOR.ENTER_P
});
});
</script>
根据@Tomkay 的评论更新:
从 CKEditor 3.6 版开始,您可以配置是否要使用 <p></p>
等标签自动包装内联内容.这是正确的设置:
Since version 3.6 of CKEditor you can configure if you want inline content to be automatically wrapped with tags like <p></p>
. This is the correct setting:
CKEDITOR.config.autoParagraph = false;
来源:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.autoParagraph
这篇关于关闭封闭 <p>CKEditor 3.0 中的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:关闭封闭 <p>CKEditor 3.0 中的标签


基础教程推荐
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01