Took me a little while to noodle through why this was correct (because the new tag actually gets inserted after the comment and whitespace, and then this textReplace replaces all the text and comments before the new tag). Might be worth a comment explaining it.