You can throw away innerHTML and replace it with the new setHTML(), which has a built-in sanitizer. Here's how it works:
@firefoxwebdevs Looks great but why is it called setHTML? What is the βsetβ supposed to mean?
@LeonardoDiOttio I see what you're getting at, but replaceChildrenWithParsedHTML is a bit long.
Fwiw when you set innerHTML you're not really setting the HTML either.