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="L2pzL2NrZWRpdG9yL2NrZWRpdG9yLmpz"></script>
<script type="text/javascript" src="L2pzL2NrZWRpdG9yL2FkYXB0ZXJzL2pxdWVyeS5qcw=="></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 中的标签


- 400或500级别的HTTP响应 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01