mirror of
https://github.com/danneu/html-parser.git
synced 2024-11-28 22:32:00 +03:00
Format readme
This commit is contained in:
parent
dc4b4a508b
commit
7a6d65abdb
@ -4,8 +4,7 @@ A lenient html5 parser implemented with [Elm](https://elm-lang.org).
|
||||
|
||||
A lenient alternative to [hecrj/elm-html-parser](https://package.elm-lang.org/packages/hecrj/html-parser/latest/).
|
||||
|
||||
**Experimental**: Also contains undocumented, unpublished, work-in-progress node tree traversal, query, and transformation in `Loc.elm` using a [Zipper](https://en.wikipedia.org/wiki/Zipper_(data_structure)) data-structure.
|
||||
|
||||
**Experimental**: Also contains undocumented, unpublished, work-in-progress node tree traversal, query, and transformation in `Loc.elm` using a [Zipper](<https://en.wikipedia.org/wiki/Zipper_(data_structure)>) data-structure.
|
||||
|
||||
## Usage
|
||||
|
||||
@ -47,15 +46,19 @@ Rendering:
|
||||
- Characters don't need to be escaped into entities.
|
||||
|
||||
e.g. `<div><:</div>` will parse correctly and doesn't need to be rewritten into `<div><:</div>`.
|
||||
|
||||
- Tags that should not nest are autoclosed.
|
||||
|
||||
e.g. `<p>a<p>b` -> `<p>a</p><p>b</p>`.
|
||||
|
||||
- Closing tags that have no matching open tags are ignored.
|
||||
|
||||
e.g. `</a><div></div></div></b>` -> `<div></div>`
|
||||
|
||||
- Ignores comments in whitespace positions:
|
||||
|
||||
e.g. `<div <!--comment-->/>` -> `<div/>`
|
||||
|
||||
- Parses comments in text node positions:
|
||||
|
||||
e.g. `div><!--comment--></div>` ->
|
||||
@ -128,8 +131,6 @@ I did this by refacoring the text parser from what was outlined above into a par
|
||||
|
||||
While it's nice to have stand-alone text parsing behavior, I will need to look more into the performance impact of this.
|
||||
|
||||
|
||||
|
||||
### The `LookAhead` parser
|
||||
|
||||
TODO
|
||||
|
Loading…
Reference in New Issue
Block a user