diff --git a/shared/static/wasm/sx/dom.sx b/shared/static/wasm/sx/dom.sx index e8506300..ddef8f06 100644 --- a/shared/static/wasm/sx/dom.sx +++ b/shared/static/wasm/sx/dom.sx @@ -97,10 +97,6 @@ (fn (child parent) (and child parent (host-call parent "contains" child)))) -(define dom-listen - (fn (el event-name handler) - (host-call el "addEventListener" event-name (host-callback handler)))) - (define dom-attr-list (fn (el) ;; Return list of (name value) pairs for all attributes on the element. diff --git a/shared/sx/ocaml_sync.py b/shared/sx/ocaml_sync.py index 1418e055..76398c06 100644 --- a/shared/sx/ocaml_sync.py +++ b/shared/sx/ocaml_sync.py @@ -132,7 +132,7 @@ class OcamlSync: def eval(self, source: str) -> str: """Evaluate SX source, return result as string.""" self._ensure() - escaped = source.replace("\\", "\\\\").replace('"', '\\"') + escaped = source.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") self._send(f'(eval "{escaped}")') return self._read_response() @@ -145,7 +145,7 @@ class OcamlSync: def load_source(self, source: str) -> str: """Load SX source directly into the kernel.""" self._ensure() - escaped = source.replace("\\", "\\\\").replace('"', '\\"') + escaped = source.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") self._send(f'(load-source "{escaped}")') return self._read_response() diff --git a/web/lib/dom.sx b/web/lib/dom.sx index e8506300..ddef8f06 100644 --- a/web/lib/dom.sx +++ b/web/lib/dom.sx @@ -97,10 +97,6 @@ (fn (child parent) (and child parent (host-call parent "contains" child)))) -(define dom-listen - (fn (el event-name handler) - (host-call el "addEventListener" event-name (host-callback handler)))) - (define dom-attr-list (fn (el) ;; Return list of (name value) pairs for all attributes on the element.