From 6dfc59cd244bddca826538512bbc1e7fe7cd7bcf Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Thu, 15 Jan 2026 01:49:28 +0100 Subject: [PATCH] sdasd --- public/assets/js/ui-editor.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/assets/js/ui-editor.js b/public/assets/js/ui-editor.js index 854d3a6..6546809 100644 --- a/public/assets/js/ui-editor.js +++ b/public/assets/js/ui-editor.js @@ -332,12 +332,15 @@ export function initEditor() {       (async() => { try { const row = await apiGet(current.resource, current.id); - jsonState = row?.content ?? row?.item?.content ?? ''; - hasJson = !!jsonState; + const rawContent = row?.content ?? row?.item?.content ?? ''; + const trimmed = String(rawContent || '').trim(); + const looksJson = trimmed.startsWith('{') || trimmed.startsWith('['); + jsonState = looksJson ? rawContent : ''; + hasJson = looksJson; // API liefert jetzt top-level html/content; fallback auf item.* fresh = row?.html ?? row?.item?.html ?? ''; - if (!fresh && !hasJson) { - fresh = row?.content ?? row?.item?.content ?? ''; + if (!fresh && !looksJson) { + fresh = rawContent; } } catch {}       })(),