Adds fix for self-closing tags

BR tags would be written as <br></br> which is
interpreted as two newlines by modern browsers.