CKEditor HTML Autocorrection问题 [英] CKEditor HTML Autocorrection Issue

查看:107
本文介绍了CKEditor HTML Autocorrection问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有几行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做修改。

< h1> 不是的有效内容, < 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屋!

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