CKEditor HTML 自动更正问题

CKEditor HTML Autocorrection Issue

我的数据库中只有几行 HTML。我想在 CKEditor 中编辑内容。但是当我在编辑器中打开它时,HTML 会崩溃。 HTML 被重新排列。

下面是数据库中的 HTML:

<span class="sec_title">
       <h1><span>Web</span> Engineering</h1>
        <hr>
</span>

当我在 CKEditor 中打开它时,HTML 如下所示:

<h1><span class="sec_title"><span>Web</span> Engineering</span></h1>

<hr />

请哪位帮帮我。我试过 config.allowedContent = true; 但它也没有停止 CKEditor 进行修改。

CKEditor 仅适用于有效的 HTML,而 <h1> 不是 <span> 的有效内容。引用 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.