node-html-parser icon indicating copy to clipboard operation
node-html-parser copied to clipboard

Feat: add option closeAllByClosing

Open ig3 opened this issue 2 weeks ago • 0 comments

If option closeAllByClosing is set to true, then all unclosed elements are closed at the end of their parent element.

This is done only after all usual heuristics for closing tags based on opening and closing tags have been exercised, to catch and close any remaining unclosed elements.

This ensures that where there is a parent element, all nested elements are closed by the close of the parent.

This will allow some cases of invalid HTML to be parsed and manipulated which otherwise might fail.

ig3 avatar Jan 07 '26 11:01 ig3