Skip to content
/ domx Public

HTML parser and DOM tree builder for rust

Notifications You must be signed in to change notification settings

hean01/domx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

domx - HTML Parser and DOM builder

Status

domx includes a small HTML [Parser] and [DOM] builder for easing the work with HTML data as structured data. The goal is to be very resilience against invalid HTML documents, eg. missing closing tag etc. In worst case you just get strange data from the parser.

The [Parser] itself runs through the HTML document and by using the trait [IsParser], implemented by the caller as handler, you will be notified when a opening tag, closing tag and data is parsed. Information through the callback is provided as [Tag], a vector of [Attribute] and data as a vector of u8. See example below how to use the [Parser] and a simple implementation of [IsParser].

The [DOM] builder uses the parser to build up a tree data structure of the HTML document. Which you can traverse and perform operations on such as cleaning up the document or just simplify it. Running a broken HTML, eg missing closing tags, into DOM and then saving it you will get a nice consistent and valid HTML file.

domx is licensed under GPLv3

About

HTML parser and DOM tree builder for rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages