CKEditor HTML Autocorrection问题 [英] CKEditor HTML Autocorrection Issue
问题描述
我的数据库中有几行HTML。我想编辑CKEditor中的内容。但是当我在编辑器中打开时,HTML被打破了。 HTML重新排列。
以下是数据库中的HTML:
span class =sec_title>
< h1>< span> Web< / span>工程< / h1>
< hr>
< / span>
当我在CKEditor中打开它时,HTML看起来如下:
< h1>< span class =sec_title>< span> Web< / span>工程< / span>< / h1>
< hr />
有人请帮助我。我尝试了 config.allowedContent = true;
但它也没有停止CKEditor做修改。
的有效内容, < span>
。引用 CKEditor基本概念: < blockquote>
CKEditor不是一个可以让您输入无效HTML代码的工具。 CKEditor遵守W3C标准,如果它无效,它将修改代码。
I have few lines of HTML in my database. I want to edit the content in CKEditor. But when I open that in editor the HTML gets break down. The HTML gets rearranged.
Below is the HTML which is in database:
<span class="sec_title">
<h1><span>Web</span> Engineering</h1>
<hr>
</span>
And when I open it in CKEditor the HTML looks likes below:
<h1><span class="sec_title"><span>Web</span> Engineering</span></h1>
<hr />
Some one please help me. I tried config.allowedContent = true;
but it is also not stopping the CKEditor to do the modifications.
CKEditor works with a valid HTML only and <h1>
is not a valid content of <span>
. Quoting CKEditor basic concepts:
CKEditor is not a tool that will let you input invalid HTML code. CKEditor abides by W3C standards so it will modify code if it is invalid.
这篇关于CKEditor HTML Autocorrection问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!