File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 7
7
DocumentType Element TextNode XmlDeclaration]
8
8
[org.jsoup.parser Tag Parser]))
9
9
10
+ (set! *warn-on-reflection* true )
11
+
10
12
(defn- end-or-recur [as-fn loc data & [skip-child?]]
11
13
(let [new-loc (-> loc (zip/replace data) zip/next (cond-> skip-child? zip/next))]
12
14
(if (zip/end? new-loc)
68
70
DocumentType
69
71
(as-hiccup
70
72
([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)))))
74
77
Element
75
78
(as-hiccup
76
79
([this] (trampoline as-hiccup this (hzip/hiccup-zip this)))
141
144
([this] (trampoline as-hickory this (hzip/hickory-zip this)))
142
145
([this loc] (end-or-recur as-hickory loc (.getWholeText this)))))
143
146
147
+ (set! *warn-on-reflection* false )
148
+
144
149
(defn parse
145
150
" Parse an entire HTML document into a DOM structure that can be
146
151
used as input to as-hiccup or as-hickory."
147
152
[s]
148
153
(Jsoup/parse s))
149
154
155
+ (set! *warn-on-reflection* true )
156
+
150
157
(defn parse-fragment
151
158
" Parse an HTML fragment (some group of tags that might be at home somewhere
152
159
in the tag hierarchy under <body>) into a list of DOM elements that can
You can’t perform that action at this time.
0 commit comments