Skip to content

Commit b23b508

Browse files
committed
[html\gen] save old 'map function
* so the `map` html element won't break the whole lib
1 parent 6da307f commit b23b508

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/generator.art

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
export module ::
33

4+
map: method => [
5+
map & & &
6+
]
7+
48
kebab: method [content :string][
59
replace content "_" "-"
610
]
@@ -22,8 +26,8 @@ voidElement: method [tag :string :literal :word htmlAttributes :dictionary][
2226
;; <https://html.spec.whatwg.org/multipage/syntax.html#void-\elements/>
2327

2428
attributes: (
25-
map htmlAttributes [key value] -> render {|\kebab key|="|value|"}
26-
| append (map attrs [key value] -> render {|\kebab key|="|value|"})
29+
\map htmlAttributes [key value] -> render {|\kebab key|="|value|"}
30+
| append (\map attrs [key value] -> render {|\kebab key|="|value|"})
2731
| join.with: " "
2832
)
2933

@@ -51,7 +55,7 @@ element: method.public [tag :string :literal content :block :string :dictionary]
5155
if dictionary? content ->
5256
return \voidElement tag content
5357

54-
attributes: (join.with: " " map attrs [key value] -> render {|\kebab key|="|value|"})
58+
attributes: (join.with: " " \map attrs [key value] -> render {|\kebab key|="|value|"})
5559
if attributes <> "" -> prepend 'attributes " "
5660

5761
if block? content ->

0 commit comments

Comments
 (0)