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

Incorrect closing of anchor tags when wrapped around a table tag #192

Open
piyush-moengage opened this issue Jun 5, 2018 · 6 comments
Open

Comments

@piyush-moengage
Copy link

Wrapping a table tag with an a tag is an HTML5 feature which is not supported.

So :

<html><head></head><body>
<a href="http://www.google.com"><table><tbody><tr>hello</tr></tbody></table></a>
</body></html>

Gets converted to:

<html><head></head><body>
<a href="http://www.google.com"></a><table><tbody><tr>hello</tr></tbody></table>
</body></html>

Notice that Premailer closes the anchor tag before the table tag.

@peterbe
Copy link
Owner

peterbe commented Jun 5, 2018

Any reason why you would want to wrap a block element in a inline element.

Pretty sure it's invalid HTML so if that's how lxml is very unlikely that premailer will try to work around this.

@elidickinson
Copy link
Contributor

HTML5 allows "block-level links" now, but I've heard it causes headaches for various screenreaders and spiders. And, apparently, LXML's HTML parser

@shyamchandranmec
Copy link

Any plans to release HTML5 parser for premailer?

@peterbe
Copy link
Owner

peterbe commented Jun 7, 2018

@shyamchandranmec What "HTML5 parser"?

@shyammoengage
Copy link

@peterbe In HTML5 it's valid to wrap block level element inside an inline element.

@peterbe
Copy link
Owner

peterbe commented Jun 11, 2018

In HTML5 it's valid to wrap block level element inside an inline element.

wow! I did not know that. Either way, premailer is "only as good" as lxml.

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

5 participants