Web-Editor: Farben/Inline-Styles beim Einfügen aus E-Mails behalten

TinyMCE registriert unter Chromium (Chrome/Edge) und Safari einen
PastePreProcess-Filter, der bei der Default-Einstellung
paste_webkit_styles:'none' ALLE inline-Styles (inkl. color) aus extern
eingefügtem Inhalt entfernt. Interner Copy/Paste ist ausgenommen — daher
ging webapp->webapp, aber E-Mail->Editor verlor die Farbe.

paste_webkit_styles:'all' schaltet den Stripper ab und behält die Styles.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GkKJBbiNV421xfCbXikGV
This commit is contained in:
Kendrick Bollens
2026-07-23 11:37:29 +02:00
parent 3f792a6434
commit 730d32ab29

View File

@@ -364,7 +364,9 @@
valid_elements: '*[*]', extended_valid_elements: '*[*]', valid_children: '+body[style]',
verify_html: false, convert_urls: false,
content_style: 'body{font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#1f2a30;line-height:1.6;padding:10px 12px;} img{max-width:100%;height:auto;} table{border-collapse:collapse;}',
paste_data_images: true, automatic_uploads: false, file_picker_types: 'image',
// Chrome/Edge/Safari entfernen sonst beim Einfügen aus externen Quellen (E-Mails)
// ALLE inline-Styles inkl. Farben ('paste_webkit_styles' default 'none'). 'all' behält sie.
paste_data_images: true, paste_webkit_styles: 'all', automatic_uploads: false, file_picker_types: 'image',
file_picker_callback: function (cb) {
const input = document.createElement('input'); input.type = 'file'; input.accept = 'image/*';
input.onchange = function () { const file = input.files[0]; if (!file) return; const r = new FileReader(); r.onload = function () { cb(r.result, { title: file.name }); }; r.readAsDataURL(file); };