Skip to content

Commit c133ef0

Browse files
committed
fix some errors
1 parent 865dd74 commit c133ef0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/clj/hickory/core.clj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
DocumentType Element TextNode XmlDeclaration]
88
[org.jsoup.parser Tag Parser]))
99

10+
(set! *warn-on-reflection* true)
11+
1012
(defn- end-or-recur [as-fn loc data & [skip-child?]]
1113
(let [new-loc (-> loc (zip/replace data) zip/next (cond-> skip-child? zip/next))]
1214
(if (zip/end? new-loc)
@@ -68,9 +70,10 @@
6870
DocumentType
6971
(as-hiccup
7072
([this] (trampoline as-hiccup this (hzip/hiccup-zip this)))
71-
([this loc] (end-or-recur as-hiccup loc (utils/render-doctype (.attr this "name")
72-
(.attr this "publicid")
73-
(.attr this "systemid")))))
73+
([this loc]
74+
(end-or-recur as-hiccup loc (utils/render-doctype (.name this)
75+
(.publicId this)
76+
(.systemId this)))))
7477
Element
7578
(as-hiccup
7679
([this] (trampoline as-hiccup this (hzip/hiccup-zip this)))
@@ -141,12 +144,16 @@
141144
([this] (trampoline as-hickory this (hzip/hickory-zip this)))
142145
([this loc] (end-or-recur as-hickory loc (.getWholeText this)))))
143146

147+
(set! *warn-on-reflection* false)
148+
144149
(defn parse
145150
"Parse an entire HTML document into a DOM structure that can be
146151
used as input to as-hiccup or as-hickory."
147152
[s]
148153
(Jsoup/parse s))
149154

155+
(set! *warn-on-reflection* true)
156+
150157
(defn parse-fragment
151158
"Parse an HTML fragment (some group of tags that might be at home somewhere
152159
in the tag hierarchy under <body>) into a list of DOM elements that can

0 commit comments

Comments
 (0)