Skip to content

Commit f0ed490

Browse files
committed
base fix
1 parent c0b4322 commit f0ed490

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

assets/scripts/base.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,18 @@ function tiny_init(container) {
10621062
}
10631063
});
10641064

1065+
// FIX: TinyMCE 8 HTML5-Schema beschränkt <span> auf [class|title] und
1066+
// strippt deshalb beim Serialisieren das style-Attribut (z. B. forecolor,
1067+
// backcolor, font-size). Wir erweitern die span-Regel hier explizit, damit
1068+
// inline-styled Spans (Farben, Größen, etc.) im getContent()-Output erhalten
1069+
// bleiben. Ohne diesen Patch verlieren Color-Toolbars und Style-Formate mit
1070+
// inline:'span' ihre style-Attribute beim Speichern.
1071+
editor.on('PreInit', function() {
1072+
if (editor.schema && typeof editor.schema.addValidElements === 'function') {
1073+
editor.schema.addValidElements('span[class|style|title|id|lang|dir|data-mce-*]');
1074+
}
1075+
});
1076+
10651077
// Register all formats so they work when applied.
10661078
// Only include defined properties in the spec – passing undefined values
10671079
// can confuse TinyMCE's internal format detection logic.

0 commit comments

Comments
 (0)