Skip to content

Commit

Permalink
fix hickory/jsoup error on native build
Browse files Browse the repository at this point in the history
  • Loading branch information
reedho committed Oct 4, 2023
1 parent 03d12a7 commit efd9774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
medley/medley {:mvn/version "1.3.0"}
mvxcvi/puget {:mvn/version "1.3.1"}
tolitius/xml-in {:mvn/version "0.1.1"}
org.clj-commons/hickory {:mvn/version "0.7.3"}}
org.clj-commons/hickory {:mvn/version "0.7.3"}
org.jsoup/jsoup {:mvn/version "1.14.3"}}
:aliases
{:run
{:main-opts ["-m" "cq.main"]}
Expand Down
7 changes: 4 additions & 3 deletions src/cq/formats.clj
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,14 @@
(defn ->html-reader
[_]
(fn [in]
(html/as-hickory (org.jsoup.Jsoup/parse in nil ""))))
(html/as-hickory (html/parse (slurp (io/reader in))))))

(defn ->html-writer
[_]
(fn [x out]
(with-open [w (io/writer out)]
(.write w (hickory-to-html x)))))
(binding [*out* (io/writer out)]
(print (hickory-to-html x))
(flush))))

(def formats
{"json" {:->reader ->json-reader
Expand Down

0 comments on commit efd9774

Please sign in to comment.