Say I have
<script>alert("hello");</script><script>alert("world");</script>
How could I remove the </script><script>
keeping in mind that there may or may not be a space in between (</script> <script>
) and I would not want to do this if either of the script tags has the source attribute (src
) set.
This should work with as many script tags as possible, so if there were three in a row that follow the same requirements, it would be turned into one big script tag.