apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.69k stars 351 forks source link

Fix trailing text issue on transformTag #521

Closed alex-rantos closed 2 years ago

alex-rantos commented 2 years ago

Fixes issue #506

Fixes regression caused by https://github.com/apostrophecms/sanitize-html/pull/395 in which addedText was never reseted to false after the ontext function was called for that tag.

Solution: reset addedText boolean to false in the onclosetag function.

alex-rantos commented 2 years ago

Thanks for review @abea ! Added a changelog entry - feel free to change the wording if needed.