retrogradeorbit / bootleg

Simple template processing command line tool to help build static websites
Eclipse Public License 2.0
255 stars 12 forks source link

hickory conversion bug when inside html tag #7

Closed retrogradeorbit closed 4 years ago

retrogradeorbit commented 4 years ago
$ bootleg -v
Version: 0.1.2

$ cat example-working.clj
(-> (mustache "example-working.html" {:heading "heading"})
    (convert-to :hickory-seq))

$ cat example-working.html
<h1>{{ heading }}</h1>

$ bootleg -d example-working.clj
({:type :element, :attrs nil, :tag :h1, :content ["heading"]} "\n")

$ bootleg example-working.clj
<h1>heading</h1>

$ cat example-broken.clj
(-> (mustache "example-broken.html" {:heading "heading"})
    (convert-to :hickory-seq))

$ cat example-broken.html
<html>
  <body>
    <h1>{{ heading }}</h1>
  </body>
</html>

$ bootleg -d example-broken.clj
("\n    ")

$ bootleg example-broken.clj

Conversion doesn't work when returned mustache markup is embedded in an html tag.

retrogradeorbit commented 4 years ago

Fixed in v0.1.3