Jinja2 syntax validation with debounced API check
All checks were successful
Validate / Hassfest (push) Successful in 3s

Two-pass validation in preview-raw endpoint:
1. Syntax check (catches {% if %}, unclosed tags)
2. StrictUndefined render (catches {{ asset.a }}, {{ bad_var }})

Frontend shows:
- Red error for syntax errors with line number
- Amber warning for undefined variables
- Error line highlighted in editor

Sample context now uses proper structured data (lists of dicts
for assets/albums) so valid field access like {{ asset.filename }}
renders correctly during preview.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 20:49:58 +03:00
parent 59108a834c
commit afb8be8101
4 changed files with 67 additions and 20 deletions

View File

@@ -360,6 +360,7 @@
"expand": "Expand",
"collapse": "Collapse",
"syntaxError": "Syntax error",
"undefinedVar": "Unknown variable",
"line": "line"
}
}