2017-05-26 1 views
5

In meiner Ckeditor-Konfiguration habe ich einen benutzerdefinierten AllowedContent. Ich weiß nicht allowedContent:true verwenden, weil ich mag nicht dem Stil-Attribut in den span-TagsCkeditor: stylesSet funktioniert nicht, wenn ich einen benutzerdefinierten allowedContent setze

mein

Das ist also allowedContent

allowedContent : 'span[class]; a[!href](*); caption; div; em; h1; h2; h3; h4; h5; h6; hr; i; img; li; ol; p[*]{*}; pre; strong; sub; sup; table; thead; tbody; tfoot; td; th; tr; tt; u; ul; dl; dt; dd; iframe;' 

werden die Stilattribute Mit dieser Konfiguration zu ermöglichen, nicht mehr auf dem erlaubten span-Tags

Das Problem ist mit meinem stylesSets:

stylesSet: 
     - { name: "style 1", element: ['div', 'p', 'a', 'span'], attributes: { class:"display_only_in_popup" } } 
     - { name: "style 2", element: ['div', 'p', 'a', 'span'], attributes: { class:"blockquote" } } 
     - { name: "style 3", element: ['div', 'p', 'a', 'span'], attributes: { class:"note" } } 
     - { name: "style 4", element: ['p', 'span'], attributes: { class:"highlight" } } 
     - { name: "style 5", element: 'span', attributes: { class:"visuallyhidden" } } 

Früher, als ich allowedContent:true hatte, ich war in der Lage zu sehen und zu verwenden Alle meine 5 Stylesets, aber jetzt, aus irgendeinem Grund, sehe ich nur die "Stil 5" im Feld Stile

Ist es möglich, meine 5 Stilsets zu halten, ohne allowedContent:true zu verwenden?

Vielen Dank

+0

Ich würde 'allowedContent' auf den Standardwert setzen und stattdessen Änderungen an' extraAllowedContent' vornehmen – Wizard

Antwort

0

Es scheint, dass Ihre 5 stylesets verwenden alle das class Attribut, aber Ihre allowedContent Regel erlaubt nur das class Attribut für die span Elemente.

Ich schlage vor, die Änderung der allowedContent Regel:

allowedContent : '*[class]; a[!href](*); caption; div; em; h1; h2; h3; h4; h5; h6; hr; i; img; li; ol; p[*]{*}; pre; strong; sub; sup; table; thead; tbody; tfoot; td; th; tr; tt; u; ul; dl; dt; dd; iframe;' 

oder, wenn Sie mehr explizit sein wollen:

allowedContent : 'div[class]; p[class]; a[class]; span[class]; a[!href](*); caption; div; em; h1; h2; h3; h4; h5; h6; hr; i; img; li; ol; p[*]{*}; pre; strong; sub; sup; table; thead; tbody; tfoot; td; th; tr; tt; u; ul; dl; dt; dd; iframe;' 

Bitte beachten Sie die documentation here.

Hinweis: Ich konnte diesen Code nicht testen, bitte lassen Sie mich in den Kommentaren wissen, ob er den Job erledigt.

Verwandte Themen