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

source tag (inside picture) is a unary tag but gets rendered with closing tag #65

Open
veritazx opened this issue Oct 26, 2016 · 3 comments

Comments

@veritazx
Copy link

veritazx commented Oct 26, 2016

The html 5 picture tag uses unary source tags to define different source locations for the image using a source tag. These tags get rendered with a closing tag by diazo. W3C-Validators rank this as markup error.
Tested in Plone 5.0.5 (5015) with Barceloneta based theme and Plone 4.3.10 (4311) with special diazo theme.
Markup example:

<picture>
    <source srcset="...">
    <img src="..." />
</picture>

renders to:

<picture>
    <source srcset="...">
        <img src="..." />
    </source>
</picture>

If there is any way to avoid this using diazo rules, I'd appreciate a hint. Thanks!

@veritazx
Copy link
Author

It is actually an lxml bug. But it prevents a clean HTML-validation for every Plone-Site that uses diazo with html5 - picture / source tags.

@rafaelbco
Copy link
Member

2021 and we still have this bug 😄 ! I guess tracked it down to libxml2, one layer deeper than lxml. It seems they have to update their HTML grammar to treat source as a self closing tag.

To make it less bad, self-close the source tag in the template, i.e <source .... />. Then it will be rendered as <source ...></source>. Which is still wrong, but better.

@rafaelbco
Copy link
Member

For the record: this is still a bug with lxml==4.9.4, the one that works with Plone 6.1 (see versions.cfg).

lxml>=5 seems not to be compatible

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

No branches or pull requests

2 participants