fix: use is string not is mapping in content-field fallback
Deploy Indiekit Server / deploy (push) Successful in 1m14s
Deploy Indiekit Server / deploy (push) Successful in 1m14s
`is mapping` is Jinja2-only — Nunjucks doesn't have it, so the test always evaluated false, falling through to the raw content object and rendering as [object Object]. Fix: `_contentFv.text or (_contentFv if _contentFv is string else "")` correctly handles both object fallback (extracts .text) and string fallback (validation re-render). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ const newSnippet = `{#- ${marker} -#}
|
|||||||
{%- set _contentFv = fieldData("content").value -%}
|
{%- set _contentFv = fieldData("content").value -%}
|
||||||
{{ textarea({
|
{{ textarea({
|
||||||
name: "content",
|
name: "content",
|
||||||
value: properties.content.text or (_contentFv.text if _contentFv is mapping else _contentFv) or "",`;
|
value: properties.content.text or _contentFv.text or (_contentFv if _contentFv is string else ""),`;
|
||||||
|
|
||||||
async function exists(p) {
|
async function exists(p) {
|
||||||
try { await access(p); return true; } catch { return false; }
|
try { await access(p); return true; } catch { return false; }
|
||||||
|
|||||||
Reference in New Issue
Block a user