4 ms·
I tried to build a non-tree HTML parser that stores tags <em><p></em></p> would have become a linked list of four nodes <em> --> <p> --> </em> --> </p> To ef
by benibela 5y ago
I tried to build a non-tree HTML parser that stores tags
<em><p></em></p> would have become a linked list of four nodes <em> --> <p> --> </em> --> </p>
To efficiently find siblings there are forward/backwards links from <em> to </em> like in a skip list.
I have implemented this list, but never actually used it that way. It became too confusing. So I now remove mismatched tags, while creating the list, making it equivalent to a tree. Now I probably should rewrite it to not actually store closing tags.
- montroser 5y agoSounds somewhat similar to linkedom[1], which performs nicely. [1]: https://github.com/WebReflection/linkedom https://github.com/WebReflection/linkedom