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.68k
stars
349
forks
source link
Option to merge subsequent tags that are the same #564
Given <span>Hello</span> <span>World</span> or <b>Hello</b> <b>World</b> it would be nice to optionally merge the tags, so the above becomes <b>Hello World</b>.
The problem to solve
Given
<span>Hello</span> <span>World</span>
or<b>Hello</b> <b>World</b>
it would be nice to optionally merge the tags, so the above becomes<b>Hello World</b>
.Alternatives
Possible with regex, but not that robust.