A HTML parsing library for c.
| chtml.c | kind of finished (for now). | |
| chtml.h | kind of finished (for now). | |
| grammar.txt | kind of finished (for now). | |
| LICENSE | kind of finished (for now). | |
| main.c | kind of finished (for now). | |
| makefile | kind of finished (for now). | |
| page.html | kind of finished (for now). | |
| README.md | kind of finished (for now). | |
CTML
A HTML parsing library for c.
Usage:
$ make && ./test page.html
Or just copy chtml.c and chtml.h to your project.
Output:
{
"html" : {
"children" : [
"head" : {
},
"body" : {
"children" : [
"button" : {
"children" : [
{ "textnode" : "bobabutton" }
]
}
]
}
]
}
}
Additional notes:
- It requires DOCTYPE to be present.
- It requires a html root tag.
- You are responsible for freeing all nodes.
- Text and elements can be distinguished by name and text pointers in DomNode.