Fix double-escaping when render forms (<>, HTML tags) appear in eval position
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m30s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m30s
Return _RawHTML wrapper so pre-rendered HTML in let bindings isn't escaped when used in render context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -102,9 +102,11 @@ async def async_eval(expr: Any, env: dict[str, Any], ctx: RequestContext) -> Any
|
||||
return await async_eval(expanded, env, ctx)
|
||||
|
||||
# Render forms in eval position — delegate to renderer and return
|
||||
# the HTML string. Allows (let ((x (<> ...))) ...) etc.
|
||||
# as _RawHTML so it won't be double-escaped when used in render
|
||||
# context later. Allows (let ((x (<> ...))) ...) etc.
|
||||
if name in ("<>", "raw!") or name in HTML_TAGS:
|
||||
return await _arender(expr, env, ctx)
|
||||
html = await _arender(expr, env, ctx)
|
||||
return _RawHTML(html)
|
||||
|
||||
# --- function / lambda call ---
|
||||
fn = await async_eval(head, env, ctx)
|
||||
|
||||
Reference in New Issue
Block a user