there is still an issue where the tokenizer needs to call the parser #230
Labels
html5 parser
Any issues related to the HTML5 parser
html5 tokenizer
Any issues related to the HTML5 tokenizer
html5
Any issues related to HTML5
there is still an issue where the tokenizer needs to call the parser (i needs to know the namespace of the adjusted current node).. connecting the parser back to the tokenizer will create a cyclic dependency and makes this very hard to get right with the borrow checker. This I think is one of the reasons many implementations of a html5parser will actually have 3 actors: the tokenizer, the parser and a tree-builder (or treesink). Here, the parser will tell the tree-builder to add / retrieve nodes, and the tokenizer can ask the tree-builder for some additional information.
Now, in order to not completely rewrite the parser (yet).. i opt for just adding the information (the adjusted-current-node's namespace) to the tokenizer call in the parser. This is a bit of an ugly hack, but it works for now, since we know that no other data from the parser is needed, and it saves a lot of time rewriting the parser.
Originally posted by @jaytaph in #182 (reply in thread)
The text was updated successfully, but these errors were encountered: