lexborisov/myhtml

JS `nodeType` equivalent?

Closed this issue · 3 comments

Hello,
Is there anything enabling to get the type of a node as with JS nodeType? I can't find it unfortunately.

Thank you

In MyHTML there is no concept of a node type. Everything is determined by tag id.
For example,

text => MyHTML_TAG__TEXT
comment => MyHTML_TAG__COMMENT
doctype => MyHTML_TAG__DOCTYPE

I highly recommend that you use a lexbor HTML parser. This is a modern and very fast parser (like a myhtml).
Please, see examples. Lexbor HTML have a node type.

@lexborisov That's interesting, I think MyHTML currently is right for my current project, but in the future I'd be happy to try Lexbor. In the meantime I think tag id will be enough for my needs.

Thank you!

@lexborisov Do you think I'm doing something wrong in #167 ? I couldn't find what scope node meant exactly in this context.