git.iko.soy/typeable/html-parse
on master help sign in
Add README
commitebdd5fa3fa5a0d3c22602bec15059e821ad10ec4 authorBen Gamari <ben@smart-cactus.org> dateThu 5 Jan 2017, 20:06 (10 years ago) parent8609b7c
1 file changed+14
README.mkd+14
README.mkdnew file+14
@@ -0,0 +1,14 @@
1+# html-parse
2+
3+`html-parse` is an efficient, reasonably robust HTML tokenizer based on the
4+HTML5 tokenization
5+[specification](https://html.spec.whatwg.org/multipage/syntax.html#tokenization).
6+The parser is written using the fast `attoparsec` parsing library and can
7+exposes both a native `attoparsec` `Parser` as well as convenience functions for
8+lazily parsing token streams out of strict and lazy `Text` values.
9+
10+For instance,
11+```haskell
12+>>> parseTokens "<div><h1>Hello World</h1><br/><p class=widget>Example!</p></div>"
13+[TagOpen "div" [],TagOpen "h1" [],ContentText "Hello World",TagClose "h1",TagSelfClose "br" [],TagOpen "p" [Attr "class" "widget"],ContentText "Example!",TagClose "p",TagClose "div"]
14+```