Remix.run Logo
croes 7 hours ago

The accepted answer is one that doesn’t care about the questioner‘s use case and instead gives a pretty excessive "Don‘t do it"

lukan 5 hours ago | parent [-]

It does also give the right solution, using an xml parser.

croes 4 hours ago | parent [-]

We don’t know the use case.

Maybe the questioner is also in full control of the HTML creation and they don’t need a parser for all possible HTML edge cases.