1
0
mirror of https://codeberg.org/setop/elm-scripting synced 2025-11-08 21:49:57 +00:00

feat: handle inner.HTML

This commit is contained in:
2025-10-05 01:39:20 +02:00
parent c68a679450
commit c1e38b6d24

6
dom.js
View File

@@ -21,6 +21,10 @@ function Node(parent, tag) {
print(this.text); print(this.text);
return return
} }
if (this.innerHTML) {
print(this.innerHTML);
return
}
std.printf("<%s", this.tagName) std.printf("<%s", this.tagName)
// Set.difference(other) is not avalable in qjs // Set.difference(other) is not avalable in qjs
for (a of Object.keys(this)) { for (a of Object.keys(this)) {
@@ -53,6 +57,8 @@ document.getElementById = (_id) => { return target}
document.createElement = (tag) => new Node(null, tag); document.createElement = (tag) => new Node(null, tag);
document.createTextNode = (text) => { t = new Node(null, "#text" ); t.text = text; return t } document.createTextNode = (text) => { t = new Node(null, "#text" ); t.text = text; return t }
var global = {};
try { try {
// here will come the Elm app code // here will come the Elm app code