Crates.io | nom_html_parser |
lib.rs | nom_html_parser |
version | 0.1.1 |
source | src |
created_at | 2020-05-03 13:34:41.485605 |
updated_at | 2020-10-08 13:12:40.481072 |
description | A parser to convert HTML string to HTML tree structure written with Nom |
homepage | |
repository | https://gitlab.com/opentooladd/nom_html_parser.git |
max_upload_size | |
id | 237049 |
size | 70,312 |
This project is an Alpha HTML parser created with nom.
The goal of this crate is to provide a performant runtime HTML parsing library to convert HTML String to HTML node structure. The library is actually rather fragile.
Rules to follow:
// good
<div>
</div>
// bad
<div></div>
<input />
// good
<div>
<div>
</div>
</div>
// bad
<div>
<div>
</div>
</div>
// good
<div class=`test`>
</div>
// bad
<div class="test">
</div>
<div>
{{test}}
{{/test}}
<p>
Test
</p>
</div>
This will result in a Text node containing all the div content. The have the structure like this you have to wrap your text node in an HTML element:
<div>
<span>
{{test}}
{{/test}}
</span>
<p>
Test
</p>
</div>
These limitations are temporary and will be fixed, but for the moment the library is usable and i will continue to improve it further. Contributions welcome :)