git.iko.soy/typeable/html-parse
on master help sign in
.github/workflows/haskell-ci.yml+2−37
since splitsnapshots
unifiedsplit
@@ -163,41 +163,6 @@ jobs:
163 compilerVersion: 8.4.1
163 compilerVersion: 8.4.1
164 setup-method: hvr-ppa
164 setup-method: hvr-ppa
165 allow-failure: false
165 allow-failure: false
166− - compiler: ghc-8.2.2
167− compilerKind: ghc
168− compilerVersion: 8.2.2
169− setup-method: hvr-ppa
170− allow-failure: false
171− - compiler: ghc-8.2.1
172− compilerKind: ghc
173− compilerVersion: 8.2.1
174− setup-method: hvr-ppa
175− allow-failure: false
176− - compiler: ghc-8.0.2
177− compilerKind: ghc
178− compilerVersion: 8.0.2
179− setup-method: hvr-ppa
180− allow-failure: false
181− - compiler: ghc-8.0.1
182− compilerKind: ghc
183− compilerVersion: 8.0.1
184− setup-method: hvr-ppa
185− allow-failure: false
186− - compiler: ghc-7.10.3
187− compilerKind: ghc
188− compilerVersion: 7.10.3
189− setup-method: hvr-ppa
190− allow-failure: false
191− - compiler: ghc-7.10.2
192− compilerKind: ghc
193− compilerVersion: 7.10.2
194− setup-method: hvr-ppa
195− allow-failure: false
196− - compiler: ghc-7.10.1
197− compilerKind: ghc
198− compilerVersion: 7.10.1
199− setup-method: hvr-ppa
200− allow-failure: false
201 fail-fast: false
166 fail-fast: false
202 steps:
167 steps:
203 - name: apt
168 - name: apt
@@ -324,8 +289,8 @@ jobs:
324 touch cabal.project
289 touch cabal.project
325 touch cabal.project.local
290 touch cabal.project.local
326 echo "packages: ${PKGDIR_html_parse}" >> cabal.project
291 echo "packages: ${PKGDIR_html_parse}" >> cabal.project
327− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package html-parse" >> cabal.project ; fi
292+ echo "package html-parse" >> cabal.project
328− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
293+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
329 cat >> cabal.project <<EOF
294 cat >> cabal.project <<EOF
330 EOF
295 EOF
331 $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(html-parse)$/; }' >> cabal.project.local
296 $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(html-parse)$/; }' >> cabal.project.local
changelog.mdnew file+10
@@ -0,0 +1,10 @@
1+# Changelog for `html-parse`
2+
3+## 0.2.1.0
4+
5+- Added support for decoding of character references (#18)
6+- All self-closing elements are now recognized as such
7+
8+## Earlier
9+
10+There be dragons.
html-parse.cabal+5−3
@@ -1,5 +1,5 @@
1name: html-parse
1name: html-parse
2−version: 0.2.0.2
2+version: 0.2.1.0
3synopsis: A high-performance HTML tokenizer
3synopsis: A high-performance HTML tokenizer
4description:
4description:
5 This package provides a fast and reasonably robust HTML5 tokenizer built
5 This package provides a fast and reasonably robust HTML5 tokenizer built
@@ -52,7 +52,8 @@ copyright: (c) 2016 Ben Gamari
52category: Text
52category: Text
53build-type: Simple
53build-type: Simple
54cabal-version: >=1.10
54cabal-version: >=1.10
55−tested-with: GHC==7.10.* GHC==8.0.*, GHC==8.2.*, GHC==8.4.*, GHC==8.6.*, GHC==8.8.*, GHC==8.10.*, GHC==9.0.*, GHC==9.2.*, GHC==9.4.*
55+tested-with: GHC==8.4.*, GHC==8.6.*, GHC==8.8.*, GHC==8.10.*, GHC==9.0.*, GHC==9.2.*, GHC==9.4.*, GHC==9.6.*
56+extra-source-files: changelog.md
56
57
57
58
58source-repository head
59source-repository head
@@ -65,7 +66,7 @@ library
65 ghc-options: -Wall
66 ghc-options: -Wall
66 hs-source-dirs: src
67 hs-source-dirs: src
67 other-extensions: OverloadedStrings, DeriveGeneric
68 other-extensions: OverloadedStrings, DeriveGeneric
68− build-depends: base >=4.7 && <4.17,
69+ build-depends: base >=4.7 && <4.19,
69 deepseq >=1.3 && <1.5,
70 deepseq >=1.3 && <1.5,
70 attoparsec >=0.13 && <0.15,
71 attoparsec >=0.13 && <0.15,
71 text >=1.2 && <2.1,
72 text >=1.2 && <2.1,
@@ -91,6 +92,7 @@ test-suite spec
91 main-is: Spec.hs
92 main-is: Spec.hs
92 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
93 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
93 ghc-options: -Wall -with-rtsopts=-T
94 ghc-options: -Wall -with-rtsopts=-T
95+ build-tool-depends: hspec-discover:hspec-discover
94 build-depends: base,
96 build-depends: base,
95 containers,
97 containers,
96 hspec,
98 hspec,
src/Text/HTML/Parser.hs+3−2
@@ -139,6 +139,7 @@ isWhitespace :: Char -> Bool
139isWhitespace '\x09' = True
139isWhitespace '\x09' = True
140isWhitespace '\x0a' = True
140isWhitespace '\x0a' = True
141isWhitespace '\x0c' = True
141isWhitespace '\x0c' = True
142+isWhitespace '\x0d' = True
142isWhitespace ' ' = True
143isWhitespace ' ' = True
143isWhitespace _ = False
144isWhitespace _ = False
144
145
@@ -412,8 +413,8 @@ renderAttrs = T.unwords . fmap renderAttr . reverse
412renderAttr :: Attr -> Text
413renderAttr :: Attr -> Text
413renderAttr (Attr k v) = mconcat [k, "=\"", v, "\""]
414renderAttr (Attr k v) = mconcat [k, "=\"", v, "\""]
414
415
415−-- | Meld neighoring 'ContentChar' and 'ContentText' constructors together and drops empty text
416+-- | Meld neighoring 'ContentChar' and 'ContentText'
416−-- elements.
417+-- constructors together and drops empty text elements.
417canonicalizeTokens :: [Token] -> [Token]
418canonicalizeTokens :: [Token] -> [Token]
418canonicalizeTokens = filter (/= ContentText "") . meldTextTokens
419canonicalizeTokens = filter (/= ContentText "") . meldTextTokens
419
420