asdasd
This commit is contained in:
@@ -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, '<').replace(/>/g, '>');
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (component.components) {
|
||||
if (!isTextLike && component.components) {
|
||||
component.components(html);
|
||||
}
|
||||
if (component.set) {
|
||||
|
||||
Reference in New Issue
Block a user