ckeditor移除< br />当br在允许的内容 [英] ckeditor removes <br/> when br is in allowed content

查看:102
本文介绍了ckeditor移除< br />当br在允许的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我向ckeditor添加br允许的内容并添加< br> 标签时,它被更改为< br / code>
但是当我添加< br /> 时会被删除。



为什么在允许的内容中删除br?任何建议?

解决方案

您的帖子中有一些缺失,不知道为什么, / p>

如果你说的是你想要添加 clear =all c $ c>< br /> 标记,您可以使用此标记更新您允许的内容:



config.AllowedContent =br [clear];



;



以下是对文档中AllowedContent规则的引用:



http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules



我将此位置于我的AllowedContent声明上面作为提示:



elements [attributes] {styles}类)



如果这不是你问的话,请原谅我,你的帖子中有一些部分遗漏了。如果你可以更新它,让我知道我会重温这个答案。



== EDIT ==



Ok,我只是查看了帖子的编辑,看起来你的问题中有裸体< br /> 标签,



您看到的是编辑器强制使用有效的HTML。 BR标签应始终格式如下:< br /> (注意空格)


When I add br to ckeditor allowed content and adding <br> tag it is being changed into <br /> But when I add <br/> it is being removed.

Why is it being removed when br is in allowed content? Any suggestions?

解决方案

There are some bits missing from your post, not sure why, or what you were trying to say.

If what you were saying is that you wanted to add, say, clear="all" to your <br /> tags, you can use this to update your allowed content:

config.AllowedContent = "br[clear]";

Separate individual elements with ;.

Here is the reference to the AllowedContent rules in the documentation:

http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules

I keep this bit in comments above my AllowedContent declaration as a reminder:

elements [attributes]{styles}(classes)

If that's not what you were asking, forgive me, again, there are some parts missing from your post. If you can update it and let me know I'll revisit this answer.

== EDIT ==

Ok, I just looked at the edit of the post, and it seems you had "naked" <br /> tags in your question, which turned into actual line breaks.

What you're seeing is that the editor is forcing valid HTML. BR tags should always be formatted as such: <br /> (notice the space)

这篇关于ckeditor移除&lt; br /&gt;当br在允许的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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