How can I get all closed tags in a given string, preferably in the order in which they should be closed?
Note. Please note that there are no errors in HTML and that it was simply disabled after the X characters. No, this is not the case with bad html or overlapping tags, etc. There will also be no end
Example: <p><span>Lorem</span><b>ipsum --- return ---> </b></p>
-OR-
<ul><li>1</li><li>2 --- return ---> </li></ul>
So, if a string is concatenated with the output of a function, it will again create valid HTML.
I'm not sure if RegExp will do the trick here, basically I want to get something between <and> that does not have a matching </> closing tag.
Thanks.
source share