Markup streams act on their cursor elem as defined in library(markup):
| Prolog | JavaScript |
|---|---|
| write('foo < bar') | elem.insertAdjacentText("beforeend", "foo < bar") |
| tag('&') | elem.insertAdjacentHTML("beforeend", "&") |
| tag('<foo>') | elem.insertAdjacentHTML("beforeend",
"<foo></foo>"); elem = elem.lastElementChild |
| tag('</foo>') | elem = elem.parentElement |
| tag('<foo/>') | elem.insertAdjacentHTML("beforeend", "</foo>") |
Further DOM actions are currently found in library(react):
| Prolog | JavaScript |
|---|---|
| clear | elem.innerHTML = "" |
| goto('k7') | elem = document.getElementById("k7") |
| bind('click', E, foo(E)) | elem.addEventListener("click", [E]>>foo(E)) |
| listen('click', E, foo(E), [block(true)]) |
let prom = waitForEvent(elem, "click",
[E]>>foo(E)) await prom |