So, I’m splitting a string using
string.split(/[><]/);
So this turns something like this:
This is some text with <b>formatting</b> in it.
into this:
This is some text with
b
formatting
/b
in it.
I would prefer if I to get something like this:
This is some text with
<b>
formatting
</b>
in it.
Because then when looping through the array, it’s less ambiguous which are tags and which aren’t.
I’ve got a few ideas I could try to do this without using split, but they are all kind of awkward, and I’m hoping there’s a simple way.