sdasd
This commit is contained in:
@@ -332,12 +332,15 @@ export function initEditor() {
|
|||||||
(async() => {
|
(async() => {
|
||||||
try {
|
try {
|
||||||
const row = await apiGet(current.resource, current.id);
|
const row = await apiGet(current.resource, current.id);
|
||||||
jsonState = row?.content ?? row?.item?.content ?? '';
|
const rawContent = row?.content ?? row?.item?.content ?? '';
|
||||||
hasJson = !!jsonState;
|
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.*
|
// API liefert jetzt top-level html/content; fallback auf item.*
|
||||||
fresh = row?.html ?? row?.item?.html ?? '';
|
fresh = row?.html ?? row?.item?.html ?? '';
|
||||||
if (!fresh && !hasJson) {
|
if (!fresh && !looksJson) {
|
||||||
fresh = row?.content ?? row?.item?.content ?? '';
|
fresh = rawContent;
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
})(),
|
})(),
|
||||||
|
|||||||
Reference in New Issue
Block a user