Highlight returns SX tree, rendered to HTML/DOM by pipeline
highlight.sx now returns a list of (span :class "..." "text") elements instead of a string. The rendering pipeline handles the rest: - Server render-to-html: produces <span class="...">text</span> - Client render-to-dom: produces DOM span elements - Aser: serializes spans as SX for client rendering Key fixes: - hl-span uses (make-keyword "class") not :class (keywords evaluate to strings in list context) - render-sx-tokens returns flat list of spans (no wrapper) - hl-escape is identity (no escaping needed for tree values) - highlight.sx added to browser bundle + platform loader - ~docs/code renders src directly as child of pre Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,8 +34,9 @@ cp "$ROOT/web/deps.sx" "$DIST/sx/"
|
||||
cp "$ROOT/web/router.sx" "$DIST/sx/"
|
||||
cp "$ROOT/web/page-helpers.sx" "$DIST/sx/"
|
||||
|
||||
# 3b. Freeze scope (signal persistence)
|
||||
# 3b. Freeze scope (signal persistence) + highlight (syntax coloring)
|
||||
cp "$ROOT/lib/freeze.sx" "$DIST/sx/"
|
||||
cp "$ROOT/lib/highlight.sx" "$DIST/sx/"
|
||||
|
||||
# 4. Bytecode compiler + VM
|
||||
cp "$ROOT/lib/bytecode.sx" "$DIST/sx/"
|
||||
|
||||
Reference in New Issue
Block a user