Schriftartformatierung

This commit is contained in:
2026-01-31 23:06:25 +01:00
parent bff7c77095
commit 1b836cb4e8
2 changed files with 15 additions and 2 deletions

View File

@@ -424,7 +424,20 @@
const modelContent = (component.get && component.get('content')) || '';
const viewHtml = (component.view && component.view.el && component.view.el.innerHTML) || '';
let htmlSource = viewHtml || modelContent || '';
const pickHtmlSource = (view, model) => {
const v = String(view || '');
const m = String(model || '');
if (!v && m) return m;
if (!m) return v;
const vHasSpan = /<span\b/i.test(v);
const mHasSpan = /<span\b/i.test(m);
const vHasStyle = /\sstyle\s*=/i.test(v);
const mHasStyle = /\sstyle\s*=/i.test(m);
if ((!vHasSpan && mHasSpan) || (!vHasStyle && mHasStyle)) return m;
if (m.length > v.length + 20) return m;
return v;
};
let htmlSource = pickHtmlSource(viewHtml, modelContent) || '';
if (!htmlSource && component && typeof component.toHTML === 'function') {
try {
const fullHtml = String(component.toHTML() || '');