XML-style empty tags were not recognized correctly when the / was not preceded by whitespace. Also made the regex a little more strict, so that </br/> wouldn't be seen as a valid tag.