Fix handler eval: use default env for aser, not handler closure

Handler closure env didn't have HTML tags (code, span, div etc.)
causing Undefined symbol errors. aser without explicit env uses
the global env which has all tags registered.

Also reverts oob-code highlight change (code tag not available in
aser context).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 14:36:15 +00:00
parent 52c8af66b9
commit 824f06d3b7
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@
:sx-swap-oob "innerHTML"
(div
:class "not-prose bg-stone-100 rounded p-4 mt-3"
(pre :class "text-sm whitespace-pre-wrap break-words" (highlight text)))))
(pre :class "text-sm whitespace-pre-wrap break-words" (code text)))))
(defcomp
~docs/attr-table

View File

@@ -41,9 +41,9 @@
(params body closure)
(if
(or (nil? params) (empty? params))
(aser body closure)
(aser body)
(let
((bindings (map (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (if (= name "&key") nil (if (= name "&rest") nil (let ((val (or (request-arg name) (request-form name)))) (list (make-symbol name) (or val nil))))))) (filter (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (and (not (= name "&key")) (not (= name "&rest"))))) params))))
(let
((let-form (list (quote let) (filter (fn (b) (not (nil? b))) bindings) body)))
(aser let-form closure))))))
(aser let-form))))))