Skip to content

Commit 0c0dc1e

Browse files
committed
Merge branch 'release/0.6.0'
2 parents 1b47e7c + d079e42 commit 0c0dc1e

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

README.md

+30-25
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parsing functions, `parse` and `parse-fragment`. Both take a string
1919
containing HTML and return the parser objects representing the
2020
document. (It happens that these parser objects are Jsoup Documents
2121
and Nodes, but I do not consider this to be an aspect worth preserving
22-
if a change in parser should become necessary).
22+
if a change in parser should become necessary).
2323

2424
The first function, `parse` expects an entire HTML document, and
2525
parses it using an HTML5 parser ([Jsoup](http://jsoup.org) on Clojure and
@@ -35,7 +35,7 @@ simply give you the list of nodes that it parsed.
3535
These parsed objects can be turned into either Hiccup vector trees or
3636
Hickory DOM maps using the functions `as-hiccup` or `as-hickory`.
3737

38-
Here's a usage example.
38+
Here's a usage example.
3939

4040
```clojure
4141
user=> (use 'hickory.core)
@@ -81,19 +81,19 @@ user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>"))) zip/next z
8181
[:html {} [:head {}] [:body {} [:a {:href "foo"} "bar" [:br {}]]]]
8282
user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>"))) zip/next zip/next zip/node)
8383
[:head {}]
84-
user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>")))
85-
zip/next zip/next
86-
(zip/replace [:head {:id "a"}])
84+
user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>")))
85+
zip/next zip/next
86+
(zip/replace [:head {:id "a"}])
8787
zip/node)
8888
[:head {:id "a"}]
89-
user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>")))
90-
zip/next zip/next
91-
(zip/replace [:head {:id "a"}])
89+
user=> (-> (hiccup-zip (as-hiccup (parse "<a href=foo>bar<br></a>")))
90+
zip/next zip/next
91+
(zip/replace [:head {:id "a"}])
9292
zip/root)
9393
([:html {} [:head {:id "a"}] [:body {} [:a {:href "foo"} "bar" [:br {}]]]])
94-
user=> (-> (hickory-zip (as-hickory (parse "<a href=foo>bar<br></a>")))
95-
zip/next zip/next
96-
(zip/replace {:type :element :tag :head :attrs {:id "a"} :content nil})
94+
user=> (-> (hickory-zip (as-hickory (parse "<a href=foo>bar<br></a>")))
95+
zip/next zip/next
96+
(zip/replace {:type :element :tag :head :attrs {:id "a"} :content nil})
9797
zip/root)
9898
{:type :document, :content [{:type :element, :attrs nil, :tag :html, :content [{:content nil, :type :element, :attrs {:id "a"}, :tag :head} {:type :element, :attrs nil, :tag :body, :content [{:type :element, :attrs {:href "foo"}, :tag :a, :content ["bar" {:type :element, :attrs nil, :tag :br, :content nil}]}]}]}]}
9999
user=> (hickory-to-html *1)
@@ -139,11 +139,11 @@ nil
139139
user=> (def site-htree (-> (client/get "http://formula1.com/default.html") :body parse as-hickory))
140140
#'user/site-htree
141141
user=> (-> (s/select (s/child (s/class "subCalender") ; sic
142-
(s/tag :div)
143-
(s/id :raceDates)
142+
(s/tag :div)
143+
(s/id :raceDates)
144144
s/first-child
145-
(s/tag :b))
146-
site-htree)
145+
(s/tag :b))
146+
site-htree)
147147
first :content first string/trim)
148148
"10, 11, 12 May 2013"
149149
```
@@ -182,17 +182,17 @@ There are also selector combinators, which take as argument some number of other
182182
- `child`: Takes any number of selectors as arguments and returns a selector that returns true when the zipper location given as the argument is at the end of a chain of direct child relationships specified by the selectors given as arguments.
183183
- `descendant`: Takes any number of selectors as arguments and returns a selector that returns true when the zipper location given as the argument is at the end of a chain of descendant relationships specified by the selectors given as arguments.
184184

185-
We can illustrate the selector combinators by continuing the Formula 1 example above. We suspect, to our dismay, that Sebastian Vettel is leading the championship for the fourth year in a row.
185+
We can illustrate the selector combinators by continuing the Formula 1 example above. We suspect, to our dismay, that Sebastian Vettel is leading the championship for the fourth year in a row.
186186

187187
```clojure
188-
user=> (-> (s/select (s/descendant (s/class "subModule")
189-
(s/class "standings")
190-
(s/and (s/tag :tr)
191-
s/first-child)
192-
(s/and (s/tag :td)
193-
(s/nth-child 2))
194-
(s/tag :a))
195-
site-htree)
188+
user=> (-> (s/select (s/descendant (s/class "subModule")
189+
(s/class "standings")
190+
(s/and (s/tag :tr)
191+
s/first-child)
192+
(s/and (s/tag :td)
193+
(s/nth-child 2))
194+
(s/tag :a))
195+
site-htree)
196196
first :content first string/trim)
197197
"Sebastian Vettel"
198198
```
@@ -250,7 +250,7 @@ the parsed data, like doctype and comments.
250250
To get hickory, add
251251

252252
```clojure
253-
[hickory "0.5.4"]
253+
[hickory "0.6.0"]
254254
```
255255

256256
to your project.clj, or an equivalent entry for your Maven-compatible build tool.
@@ -261,6 +261,11 @@ Hickory expects a DOM implementation and thus won't work out of the box on node.
261261

262262
## Changes
263263

264+
- Released version 0.6.0.
265+
* Updated JSoup to version 1.8.3. This version of JSoup contains bug fixes, but slightly changes the way it
266+
handles HTML: some parses and output might have different case than before. HTML is still case-insensitive,
267+
of course, but Hickory minor version has been increased just in case. API and semantics are otherwise unchanged.
268+
264269
- Released version 0.5.4.
265270
* Fixed project dependencies so ClojureScript is moved to a dev-dependency.
266271

project.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject hickory "0.5.4"
1+
(defproject hickory "0.6.0"
22
:description "HTML as Data"
33
:url "http://github.com/davidsantiago/hickory"
44
:license {:name "Eclipse Public License"

0 commit comments

Comments
 (0)