I have some text that contains HTML (to be rendered in the browser), as well as arbitrary strings with <>. Is there a way to escape those arbitrary tags, but preserve the HTML? If it helps, the HTML being parsed is very strictly governed, and only a subset of tags is allowed (b, i, strong, br)
For example. Given this text:
<strong>Foobar</strong> <some other whatever>
I need
<strong>Foobar</strong> <some other whatever>
<some>could be a valid HTML tag as well with two (empty) attributesotherandwhatever.{some other wathever}.....