aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2024-04-16 18:32:18 +0100
committerGitHub <noreply@github.com>2024-04-16 18:32:18 +0100
commit0d30e9c35329e2ad4a6277a2b5f4d5115fb4d274 (patch)
tree55d9ec6729398eaceb472dd820ed478818a76855 /src
parent7f17ed5825d73b19c0483ccf03e75702a989e7b9 (diff)
downloadlustre-0d30e9c35329e2ad4a6277a2b5f4d5115fb4d274.tar.gz
lustre-0d30e9c35329e2ad4a6277a2b5f4d5115fb4d274.zip
🐛 Fixed a bug with `Map` nodes not turning into document strings correctly. (#107)
* :bug: Fixed a bug where stringifying a 'Map' element produced incorrect document strings. * :bookmark: Bump to v4.1.7
Diffstat (limited to 'src')
-rw-r--r--src/lustre/element.gleam2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lustre/element.gleam b/src/lustre/element.gleam
index 412c7e3..8487db3 100644
--- a/src/lustre/element.gleam
+++ b/src/lustre/element.gleam
@@ -313,6 +313,7 @@ pub fn to_document_string(el: Element(msg)) -> String {
Element(tag: "html", ..) -> el
Element(tag: "head", ..) | Element(tag: "body", ..) ->
element("html", [], [el])
+ Map(subtree) -> subtree()
_ -> element("html", [], [element("body", [], [el])])
})
@@ -341,6 +342,7 @@ pub fn to_document_string_builder(el: Element(msg)) -> StringBuilder {
Element(tag: "html", ..) -> el
Element(tag: "head", ..) | Element(tag: "body", ..) ->
element("html", [], [el])
+ Map(subtree) -> subtree()
_ -> element("html", [], [element("body", [], [el])])
})