Skip to content

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


Using Regex to parse and manipulate HTML is a recipe for disaster. There are too many edge cases you have to account for.

If you really want to "optimize" the HTML, you may end up having to parse HTML into some kind of AST and work from there. But this is probably more complex than the editor itself you want to build.

code of conduct - report abuse