From 824f06d3b7c066f58e8fa70d61905a4609366a71 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 1 Apr 2026 14:36:15 +0000 Subject: [PATCH] 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) --- sx/sx/docs.sx | 2 +- sx/sx/handlers/dispatch.sx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sx/sx/docs.sx b/sx/sx/docs.sx index 2296c641..2dc3ea9b 100644 --- a/sx/sx/docs.sx +++ b/sx/sx/docs.sx @@ -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 diff --git a/sx/sx/handlers/dispatch.sx b/sx/sx/handlers/dispatch.sx index 8eede890..bfb071f9 100644 --- a/sx/sx/handlers/dispatch.sx +++ b/sx/sx/handlers/dispatch.sx @@ -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))))))