This commit is contained in:
2026-01-31 23:20:20 +01:00
parent 1b836cb4e8
commit 6e8f32e1dd
3 changed files with 27 additions and 14 deletions

View File

@@ -181,10 +181,9 @@
const isText = (component.is && component.is('text'))
|| (component.get && component.get('type') === 'text');
try {
if (isText && component.components) {
try {
component.components(content);
} catch {}
const hasInlineStyle = /style\s*=\s*["'][^"']*["']/.test(content) || /<span\b/i.test(content);
if (isText && component.components && !hasInlineStyle) {
try { component.components(content); } catch {}
}
if (component.set) component.set('content', content);
} catch {}
@@ -876,10 +875,18 @@
);
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h10v2H4z'), 'Liste (ungeordnet)', 'insertUnorderedList');
addButton(icon('M4 6h4v2H4V6zm0 4h4v2H4v-2zm0 4h4v2H4v-2zm6-8h10v2H10V6zm0 4h10v2H10v-2zm0 4h10v2H10v-2z'), 'Liste (geordnet)', 'insertOrderedList');
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h12v2H4z'), 'Linksbundig', 'justifyLeft');
addButton(icon('M5 7h14v2H5zM4 11h16v2H4zM5 15h14v2H5z'), 'Zentriert', 'justifyCenter');
addButton(icon('M10 7h10v2H10zM4 11h16v2H4zM8 15h12v2H8z'), 'Rechtsbuendig', 'justifyRight');
addButton(icon('M4 7h16v2H4zM4 11h16v2H4zM4 15h16v2H4z'), 'Blocksatz', 'justifyFull');
addButton(icon('M4 7h10v2H4zM4 11h16v2H4zM4 15h12v2H4z'), 'Linksbundig', null, null, () => {
applyComponentStyle({ textAlign: 'left' });
});
addButton(icon('M5 7h14v2H5zM4 11h16v2H4zM5 15h14v2H5z'), 'Zentriert', null, null, () => {
applyComponentStyle({ textAlign: 'center' });
});
addButton(icon('M10 7h10v2H10zM4 11h16v2H4zM8 15h12v2H8z'), 'Rechtsbuendig', null, null, () => {
applyComponentStyle({ textAlign: 'right' });
});
addButton(icon('M4 7h16v2H4zM4 11h16v2H4zM4 15h16v2H4z'), 'Blocksatz', null, null, () => {
applyComponentStyle({ textAlign: 'justify' });
});
const linkModal = doc.createElement('div');
linkModal.style.display = 'none';
linkModal.style.position = 'absolute';