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

Question about self-closing tags #263

Open
pavel-mikhadyuk-redshelf opened this issue Aug 23, 2021 · 1 comment
Open

Question about self-closing tags #263

pavel-mikhadyuk-redshelf opened this issue Aug 23, 2021 · 1 comment

Comments

@pavel-mikhadyuk-redshelf

I used premailer==3.6.1 on the project. And the html which is passed to transform method has self-enclosing tags but premailer turns them in tags omitted end tag.
I would not notice that but I used https://validator.w3.org/ for checking result html
For example,

Error Line 4, Column 72: end tag for "meta" omitted, but OMITTAG NO was specified


You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Also doctype declaration was omitted in the result html.

I use such structure:

<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    ...
</head>

<body>
...
</body>
</html>

Q: - Are there ways for keeping end tag in self-closing tags and doctype in the result html after premailer handling?

@peterbe
Copy link
Owner

peterbe commented Aug 27, 2021

I honestly don't know. What does premailer do? Does it spit out

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

or

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

or

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>

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