pushup icon indicating copy to clipboard operation
pushup copied to clipboard

parser: Handle self-closing elements and void elements

Open paulsmith opened this issue 1 year ago • 0 comments

  • Add selfClosing field to nodeElement struct to track self-closing tags
  • Update match function to accept multiple token types
  • Check for self-closing tags in parseElement and set selfClosing field
  • Return early for void elements in parseElement
  • Refactor parseChildren to handle both start and self-closing tags
  • Add isVoidElement function 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

paulsmith avatar Apr 04 '24 21:04 paulsmith