diff --git a/orders/sxc/pages/orders.sx b/orders/sxc/pages/orders.sx index f9851c1..8c5bec6 100644 --- a/orders/sxc/pages/orders.sx +++ b/orders/sxc/pages/orders.sx @@ -28,7 +28,7 @@ :search-headers-desktop "{\"X-Origin\":\"search-desktop\",\"X-Search\":\"true\"}") :content (let* ((pfx (route-prefix)) (detail-url-raw (str pfx (url-for "defpage_order_detail" :order-id 0))) - (detail-prefix (slice detail-url-raw 0 (- (length detail-url-raw) 2))) + (detail-prefix (slice detail-url-raw 0 (- (len detail-url-raw) 2))) (rows-url (str pfx (url-for "orders.orders_rows")))) (~orders-list-content :orders orders diff --git a/shared/sx/parser.py b/shared/sx/parser.py index 3d085cf..d5ed399 100644 --- a/shared/sx/parser.py +++ b/shared/sx/parser.py @@ -336,6 +336,17 @@ def serialize(expr: Any, indent: int = 0, pretty: bool = False) -> str: items.append(serialize(v, indent, pretty)) return "{" + " ".join(items) + "}" + # _RawHTML — pre-rendered HTML; wrap as (raw! "...") for SX wire format + from .html import _RawHTML + if isinstance(expr, _RawHTML): + escaped = ( + expr.html.replace("\\", "\\\\") + .replace('"', '\\"') + .replace("\n", "\\n") + .replace("