taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Implement more getters and methods on HTMLElement, in accordance with the DOM spec #281

Closed Maluscat closed 2 days ago

Maluscat commented 1 month ago

Hi, First of all, thanks for writing this library, it's a really clever yet simple DOM abstraction!

I implemented some methods that I felt were missing from the HTMLElement. They are commonly used in the actual DOM and thus provide better compatibility with other backend DOM abstractions as well (in my case, I switched from deno-dom to node-html-parser, and I had to shim some of these).

The last four are now the base operations. insertAdjacentHTML and appendChild use them and they are tested accordingly.

README documentation is also included :v: