关闭附加的< p>标签在CKEditor 3.0 [英] Turn off enclosing <p> tags in CKEditor 3.0

查看:96
本文介绍了关闭附加的< p>标签在CKEditor 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能关闭自动封闭< p>< / p>内的所有书写内容,在CKEditor 3.x?



我试过了

  CKEDITOR.config .enterMode = CKEDITOR.ENTER_BR; 

但这只是将内嵌换行符更改为< br /



目前正在写Test生成此输出

 < p> 
Test< / p>

但我希望它只是

 测试

是否有配置属性,

CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR; - 这对我完美的。
您尝试清除浏览器缓存 - 有时这是一个问题。

您也可以使用jQuery适配器检查:

 < script type =text / javascriptsrc =/ js / ckeditor / ckeditor.js>< / script& 
< script type =text / javascriptsrc =/ 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> ; 。这是正确的设置:

  CKEDITOR.config.autoParagraph = false; 

资料来源:
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.autoParagraph


Is there a possibility to turn off the automatic enclosing of all written content within <p></p> in CKEditor 3.x?

I tried

  CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;

but this just changes the inline linebreaks to <br /> while leaving the enclosing paragraph.

Currently writing "Test" produces this output

<p>
    Test</p>

but I want it to be simply

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; - 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>


UPDATE according to @Tomkay's comment:

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;

Source: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.autoParagraph

这篇关于关闭附加的&lt; p&gt;标签在CKEditor 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆