diff --git a/shared/sx/async_eval.py b/shared/sx/async_eval.py index b810129..bb617cf 100644 --- a/shared/sx/async_eval.py +++ b/shared/sx/async_eval.py @@ -1064,7 +1064,16 @@ async def async_eval_slot_to_sx( if result is None or result is NIL: return SxExpr("") if isinstance(result, str): - # Plain strings from page helpers are already sx source — don't quote. + # Page helpers return sx source strings. If the string is a + # component call (starts with "(~"), re-parse and expand it + # server-side so that Python-only helpers like ``highlight`` + # inside the component body get evaluated here, not on the client. + stripped = result.strip() + if stripped.startswith("(~"): + from .parser import parse_all + parsed = parse_all(stripped) + if parsed: + return await async_eval_slot_to_sx(parsed[0], env, ctx) return SxExpr(result) return SxExpr(serialize(result))