2015-07-10 86 views
1

想要告訴嵌入在Kentico CMS中的CKeditor v4.4.2實例停止過濾&允許我想要的任何內容。<figure>&<figcapture> CKeditor中的標籤

舉例來說,它不斷搞亂我的數字& figcapture標籤,有時會錯誤地關閉,有時會將其刪除,有時會用段落標籤替換標籤。

我花了好幾天試圖跟蹤下來,並試圖很多:

config.allowedContent = true; 
config.extraAllowedContent = 'figure figcapture'; 
CKEDITOR.dtd.$editable.figure = 1; 
CKEDITOR.dtd.$editable.figcaption = 1; 
CKEDITOR.dtd.$removeEmpty['figure'] = false;' 
CKEDITOR.dtd.$removeEmpty['figcapture'] = false; 
config.protectedSource.push(/<figure[\s\S]*?>/gi) ; 
config.protectedSource.push(/<\/figure[\s\S]*?>/gi) ; 
config.forcePasteAsPlainText = true; 

這一切都不工作。它似乎甚至沒有改變行爲。 我可能會錯過什麼?

回答

1

<figcapture>? HTML中沒有這樣的元素。你的意思是<figcaption>這就足夠了:

config.extraAllowedContent = 'figure figcaption'; 
+1

你是對的,我完全摸索打字和級聯它通過剪切和粘貼。有時你只需要一雙新鮮的眼睛......謝謝。 –