3`html-parse` is an efficient, reasonably robust HTML tokenizer based on the
5[specification](https://html.spec.whatwg.org/multipage/syntax.html#tokenization).
6The parser is written using the fast `attoparsec` parsing library and can
7exposes both a native `attoparsec` `Parser` as well as convenience functions for
8lazily parsing token streams out of strict and lazy `Text` values.
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"]
18Here are some typical performance numbers taken from parsing a fairly
19long [Wikipedia article](https://en.wikipedia.org/wiki/New_York_City),
21benchmarking Forced/tagsoup fast Text
22time 171.2 ms (166.4 ms .. 177.3 ms)
23 0.999 R² (0.997 R² .. 1.000 R²)
24mean 171.9 ms (169.4 ms .. 173.2 ms)
25std dev 2.516 ms (1.104 ms .. 3.558 ms)
26variance introduced by outliers: 12% (moderately inflated)
28benchmarking Forced/tagsoup normal Text
29time 176.9 ms (167.3 ms .. 188.5 ms)
30 0.998 R² (0.994 R² .. 1.000 R²)
31mean 180.7 ms (177.5 ms .. 183.7 ms)
32std dev 4.246 ms (2.316 ms .. 5.803 ms)
33variance introduced by outliers: 14% (moderately inflated)
35benchmarking Forced/html-parser
36time 20.88 ms (20.60 ms .. 21.25 ms)
37 0.999 R² (0.998 R² .. 0.999 R²)
38mean 20.99 ms (20.81 ms .. 21.20 ms)
39std dev 446.1 μs (336.4 μs .. 596.2 μs)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list