pushup
pushup copied to clipboard
parser: Handle self-closing elements and void elements
- Add
selfClosingfield tonodeElementstruct to track self-closing tags - Update
matchfunction to accept multiple token types - Check for self-closing tags in
parseElementand setselfClosingfield - Return early for void elements in
parseElement - Refactor
parseChildrento handle both start and self-closing tags - Add
isVoidElementfunction to check if a tag is a void element - Update tests to cover self-closing and void elements
🌟 These changes improve the HTML parser to properly handle self-closing elements and void elements according to the HTML spec.
Fixes #126