lua-htmlparser
lua-htmlparser copied to clipboard
Add text nodes
This PR adds text content as children nodes to the parent node, e.g. <p>Hello<br>World</p> will parse to a p node with 3 children: a text node containing Hello, the br node, and a text node containing World. A text node has nil as its tagname (because it has no tagname), but we can discuss this choice. The added and modified tests give some sense of the new behavior.
This is similar to #49 with a few differences:
- Text nodes have
nilas tagname which will never create collisions - This PR supports multiple text nodes intermixed with nested tags, like
<p>Hello<br>World</p>