milkshakesoftware/PreMailer.Net

Replace html tag (<u></u>) with invalid self-closing tag (<u/>)

stark-mkl opened this issue · 0 comments

I have this email body:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head></head><body> <div> <br> <u></u> <p>xxxxx, </p><p>XXX – xxxxxxxxxxxxxx</p><p>xxxxxxxxxxxxxxxxxxxxxxx</p><p>xxxxxxxxxxxx</p><p><br></p><p>xxxxxxxx</p><p>xx &amp; the xxxx xxxx </p><p><br></p><br><hr><p> <span style="font-size:11px;font-family:&quot;Arial&quot;,sans-serif;color:#6f787f;background:white">xxxxxxxxxxx<strong>xxxxxx</strong>xxxxxxxx <strong>xxxxx</strong>xxxxxxxx</span> <span style="font-size:11px;font-family:&quot;Arial&quot;,sans-serif;color:#6f787f"><br><br> </span> </p> <img src="https://mandrillapp.com/track/open.php?u=xxxxxxx&amp;id=xxxxx" height="1" width="1"> </div> </div> <br clear="both"> </body></html>

which contains a text empty <u></u> tag. After pass it to MoveCssInline(), the <u></u> is replaced with <u/> that is invalid and causes the rest text to be underlined:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head /><body> <div> <br /> <u /> <p>xxxxx,&#160;</p><p>XXX – xxxxxxxxxxxxxx</p><p>xxxxxxxxxxxxxxxxxxxxxxx</p><p>xxxxxxxxxxxx</p><p><br /></p><p>xxxxxxxx</p><p>xx &amp; the xxxx xxxx </p><p><br /></p><br /><hr /><p> <span style="font-size:11px;font-family:&quot;Arial&quot;,sans-serif;color:#6f787f;background:white">xxxxxxxxxxx<strong>xxxxxx</strong>xxxxxxxx <strong>xxxxx</strong>xxxxxxxx</span> <span style="font-size:11px;font-family:&quot;Arial&quot;,sans-serif;color:#6f787f"><br /><br /> </span> </p> <img src="https://mandrillapp.com/track/open.php?u=xxxxxxx&amp;id=xxxxx" height="1" width="1" /> </div> <br clear="both" /> </body></html>