![](/img/trans.png)
[英]Prevent CKEditor from removing invalid style declarations in style attributes
[英]CkEditor removing “text/css” content from “style” tag
我需要一些CkEditor v4.5.7的幫助。 當我嘗試使用下面將要顯示的元素手動添加一些源代碼時,編輯器從text/css
行中刪除/css
文本,當我從源區域切換到普通編輯器區域時。
之前
我將發布沒有“<>”字符的“After”,因為論壇只是讓我發布2個鏈接:
style type =“text”> a:link {color:red; }
a:訪問過{color:green; }
/樣式
在論壇上查看其他一些信息,我看到有人說大多數這些問題都是通過添加config.allowedContent = true;
來解決的config.allowedContent = true;
config.js元素的參數,但在我的情況下,它不起作用。 下面是我的config.js,請檢查一下,看看我做錯了什么。
Config.js
希望您能夠幫助我。 非常感謝,抱歉我的英語不好。
我認為您的配置文件可能有問題,或者您可能沒有使用4.5.7版的最新文件。
您可以查看此示例: https : //jsfiddle.net/j0nktq82/
(那里的文件從CDN加載了CKEditor的4.5.7版本)。
您可以單擊Source按鈕幾次,看到沒有任何更改,輸出為:
<style type="text/css">a:link { color: red;}
a:visited { color: green;}
</style>
<p><a href="#">Link Example</a><br />
<a href="https://www.google.com/">Link Example</a></p>
如果您能夠提供演示該問題的鏈接,則可能有助於確定如何解決該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.