html-conduit 1.3.2.1 → 1.3.2.2
raw patch · 4 files changed
+29/−3 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- html-conduit.cabal +4/−2
- src/Text/HTML/DOM.hs +4/−1
- test/main.hs +17/−0
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for `html-conduit` +## 1.3.2.2++* Fix handling of mixed case void tags [#167](https://github.com/snoyberg/xml/issues/167)+ ## 1.3.2.1 * Allow xml-conduit 1.9
html-conduit.cabal view
@@ -1,5 +1,5 @@ Name: html-conduit-Version: 1.3.2.1+Version: 1.3.2.2 Synopsis: Parse HTML documents using xml-conduit datatypes. Description: This package uses tagstream-conduit for its parser. It automatically balances mismatched tags, so that there shouldn't be any parse failures. It does not handle a full HTML document rendering, such as adding missing html and head tags. Note that, since version 1.3.1, it uses an inlined copy of tagstream-conduit with entity decoding bugfixes applied. Homepage: https://github.com/snoyberg/xml@@ -10,9 +10,10 @@ Category: Web, Text, Conduit Build-type: Simple Extra-source-files: test/main.hs README.md ChangeLog.md LICENSE-tagstream-conduit-Cabal-version: >=1.8+Cabal-version: >=1.10 Library+ default-language: Haskell2010 Exposed-modules: Text.HTML.DOM other-modules: Text.HTML.TagStream hs-source-dirs: src@@ -31,6 +32,7 @@ , conduit-extra test-suite test+ default-language: Haskell2010 type: exitcode-stdio-1.0 main-is: main.hs hs-source-dirs: test
src/Text/HTML/DOM.hs view
@@ -77,7 +77,10 @@ toName l = XT.Name l Nothing Nothing closeStack = mapM_ (yield . XT.EventEndElement) - isVoid = flip Set.member $ Set.fromList+ isVoid name = Set.member (T.toLower name) voidSet++voidSet :: Set.Set T.Text+voidSet = Set.fromList [ "area" , "base" , "br"
test/main.hs view
@@ -97,6 +97,23 @@ ] ] in H.parseLBS html @?= doc+ it "Mixed case br #167" $+ let html = "<html><head><title>foo</title></head><body><bR><p>Hello World</p><BR>done</body></html>"+ doc = X.Document (X.Prologue [] Nothing []) root []+ root = X.Element "html" Map.empty+ [ X.NodeElement $ X.Element "head" Map.empty+ [ X.NodeElement $ X.Element "title" Map.empty+ [X.NodeContent "foo"]+ ]+ , X.NodeElement $ X.Element "body" Map.empty+ [ X.NodeElement $ X.Element "bR" Map.empty []+ , X.NodeElement $ X.Element "p" Map.empty+ [X.NodeContent "Hello World"]+ , X.NodeElement $ X.Element "BR" Map.empty []+ , X.NodeContent "done"+ ]+ ]+ in H.parseLBS html @?= doc it "doesn't double unescape" $ let html = "<p>Hello &gt; World</p>"