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 中的标签
基础教程推荐
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
