fixed tag wrapping (http://stackoverflow.com/a/27073730/1223693)