Unary tags (like a <br>) should be closed well in hxtml Line #193 results += (unary ? "/" : "") + ">"; should be Line #193 results += (unary ? " /" : "") + ">"; because a <br> should be designed as <br /> instead of <br/> (with a space before the slash).