Format readme

This commit is contained in:
Dan Neumann 2022-06-01 18:04:59 -05:00
parent dc4b4a508b
commit 7a6d65abdb

View File

@ -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>&lt;:</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