Fork me on GitHub
#nextjournal
<
2021-11-08
>
grahamcarlyle13:11:18

Clerk's version of hiccup doesnt seem to support a seq as a parameter for the element's body

grahamcarlyle13:11:26

(clerk/html
  [:ul [:li 1] [:li 2] [:li 3] [:li 4]])

(clerk/html
  [:ul
   (for [x (range 1 4)]
     [:li x])])

grahamcarlyle13:11:18

I get this error in the notebook

{:via [{:type java.lang.IllegalArgumentException :message "No value supplied for key: [:li 3]" :at [clojure.lang.PersistentHashMap create "PersistentHashMap.java" 77
 :trace [[clojure.lang.PersistentHashMap create "PersistentHashMap.java" 77 [nextjournal.clerk.viewer$assign_closing_parens invokeStatic "viewer.cljc" 368 [nextjournal.clerk.viewer$assign_closing_parens invoke "viewer.cljc" 368 [nextjournal.clerk.viewer$assign_closing_parens$fn__1928$fn__1929 invoke "viewer.cljc" 383 ..."

mkvlr16:11:26

thanks for the report! Looking into it.

mkvlr16:11:36

(I can reproduce the problem)

mkvlr17:11:29

can you try https://github.com/nextjournal/clerk/commit/1678b2959840ee226b988cf112a17d7f3575dd79? Plan to cut a release with this tomorrow

đź‘Ť 1
grahamcarlyle12:11:14

that sha didn't work for me as a git dep, but when i used the sha "e07c13071408f36402a1269430c6a8beb33d43fe" then seqs in hiccup element bodies worked fine for me thanks

🙏 1
mkvlr17:11:47

I did force push so the sha changed…

mkvlr17:11:52

thanks for trying it!