This commit is contained in:
2026-01-16 22:46:17 +01:00
parent a60d6d0b4f
commit 55dbd82ca7

View File

@@ -290,11 +290,16 @@
saveBtn.style.color = '#ffffff';
saveBtn.style.cursor = 'pointer';
saveBtn.addEventListener('click', () => {
const html = content.innerHTML;
let html = String(content.innerHTML || '').trim();
const isTextLike = component && component.is && (component.is('text') || component.is('button') || component.is('link'));
const hasTags = /<[^>]+>/.test(html);
if (!html) {
const fallbackText = String(content.textContent || '').trim();
if (fallbackText) {
html = fallbackText.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
}
try {
if (component.components) {
if (!isTextLike && component.components) {
component.components(html);
}
if (component.set) {