asdasd
This commit is contained in:
@@ -290,11 +290,16 @@
|
|||||||
saveBtn.style.color = '#ffffff';
|
saveBtn.style.color = '#ffffff';
|
||||||
saveBtn.style.cursor = 'pointer';
|
saveBtn.style.cursor = 'pointer';
|
||||||
saveBtn.addEventListener('click', () => {
|
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 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, '<').replace(/>/g, '>');
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (component.components) {
|
if (!isTextLike && component.components) {
|
||||||
component.components(html);
|
component.components(html);
|
||||||
}
|
}
|
||||||
if (component.set) {
|
if (component.set) {
|
||||||
|
|||||||
Reference in New Issue
Block a user