mirror of
https://codeberg.org/setop/elm-scripting
synced 2025-11-08 21:49:57 +00:00
handle innerHTML
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
elm 0.19.1
|
elm 0.19.1
|
||||||
|
python 3.13.1-v2
|
||||||
|
|||||||
7
TODO.md
7
TODO.md
@@ -18,10 +18,11 @@
|
|||||||
|
|
||||||
# Minor
|
# Minor
|
||||||
|
|
||||||
- [ ] support for Elm debug mode (qjs does not implement `console.warn`, only `console.log`)
|
- [ ] support for Elm debug (`-d`) mode (qjs does not implement `console.warn`, only `console.log`)
|
||||||
- [ ] in debug mode, keep the output
|
- [ ] in debug mode, keep the output
|
||||||
- [ ] allow to specify or guess the main module name
|
- [x] allow to specify or guess the main module name
|
||||||
- [ ] allow to create standalone (`s`) HTML document instead of fragment
|
- [x] if `innerHTML` attribute is set, output its value instead of the node tree
|
||||||
|
- [ ] allow to create standalone (`-s`) HTML document instead of fragment
|
||||||
- [ ] silence elm compiler message when successful
|
- [ ] silence elm compiler message when successful
|
||||||
- [ ] skip compilation steps if source has not been modified ; run directly ; this mean keeping the output
|
- [ ] skip compilation steps if source has not been modified ; run directly ; this mean keeping the output
|
||||||
- [ ] add proper copyright and license
|
- [ ] add proper copyright and license
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
w1="$(mktemp out_$$_1_XXXX.js)"
|
w1="$(mktemp out_$$_1_XXXX.js)"
|
||||||
|
|
||||||
#elm make --optimize --output=${w1} src/Main.elm 1>&2
|
elm make --output=${w1} $1 1>&2
|
||||||
elm make --output=${w1} src/Main.elm 1>&2
|
|
||||||
sed -i -e 's!console.warn(!console.log(!g' ${w1}
|
sed -i -e 's!console.warn(!console.log(!g' ${w1}
|
||||||
|
|
||||||
w2="$(mktemp out_$$_XXXX.js)"
|
w2="$(mktemp out_$$_XXXX.js)"
|
||||||
|
|||||||
10
dom.js
10
dom.js
@@ -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)) {
|
||||||
@@ -52,3 +56,9 @@ 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 }
|
||||||
|
|
||||||
|
|
||||||
|
// workaround for elm-explorations/markdown Markdown.toHtml
|
||||||
|
global = {};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user