Skip to content

Conversation

@ig3
Copy link

@ig3 ig3 commented Jan 7, 2026

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 added 4 commits January 7, 2026 14:26
Close all non-closed elements when containing element closes. To fix
issue taoqf#294. Added as an option so that behaviour does not change for
those who do not opt in to the new behaviour.
Intention was to add it as a devDependency, but added it as a dependency
by mistake.
Move tests of option closeAllByClose to test/tests/unclosedtags.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant