Skip to content

re: How to normalize (join together) bold nodes in HTML DOM? VIEW POST


Simply remove any occurence of "</b><b>":

"Lorem <b>Ipsum</b><b> Dolor</b> Sit Amet".replace("</b><b>", "")


Would be good to do this in a regex that also looks for whitespace between the two tags.


I thought about that as well, but then you'd change the content (if only ever so slightly) for a trivial QoL improvement

If you use a capture group, you could put every bit of whitepace back.

code of conduct - report abuse