PreMailer.Net
PreMailer.Net copied to clipboard
PreMailer removes closing tags from IMG
Hi, When running some tests I found that PreMailer removes the closing '/' from an IMG tag. This causes XHTML validation to fail on the resulting Html.
e.g.
<html>
<head>
<style> img { padding-bottom: 5px; } </style>
</head>
...
<img src="myPic.png"/>
after parsing, the img tag becomes
<img src="myPic.png" style="padding-bottom: 5px;">
(The closing / is removed by PreMailer)
UPDATE: It appears that the closing slash is removed from all self closing tags (img, br, col, input etc) - This causes a problem when the output html is required to be XHTML compliant.
Thanks
Gary
PreMailer makes use of AngleSharp. This answer on SO from Florian Rappl - the author of AngleSharp - gives an answer why things are like you described. This one may help as well.