Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreMailer removes closing tags from IMG #162

Open
GSDUser opened this issue Oct 26, 2018 · 1 comment
Open

PreMailer removes closing tags from IMG #162

GSDUser opened this issue Oct 26, 2018 · 1 comment

Comments

@GSDUser
Copy link

GSDUser commented Oct 26, 2018

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

@axunonb
Copy link
Contributor

axunonb commented Dec 30, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants