-
Notifications
You must be signed in to change notification settings - Fork 84
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
Remove unneeded trailing slash of void elements #840
Conversation
Po4a doesn't seem to like removing "/"? Checks fail. |
I thought we're using HTML5? |
At a guess, do files declare that with a doctype? If we're leaving parsers to guess, it's easy to guess wrongly. |
We do have a doctype html tag, so it should be interpreted as html5. |
In
when updating the language files. Does that mean po4a thinks it's using It looks like that then has a knock on effect as, later, in
and then fails. Then,
|
Yes, that's what I suspect. |
Mm. Nothing obvious like unbalanced tags... The document itelf doesn't have a |
I searched for it but didn't find anything. |
I can't really look into it properly yet until Monday but yes, html docs are processed as xml by po4a. I think the checks for tag "errors" can be disabled or left at just a warning (without aborting the file processing), as it seems to default to aborting. There's info about this in the official po4a documentation. It should be a matter of adding a config parameter to the scripts. |
I'd really like to leave the config until we identify what's changed to cause it to start breaking. |
Here's the relevant page in the po4a docs - scroll down to "ontagerror". It seems that po4a interprets that On closer inspection, I was using "ontagerror", but maybe "optionalclosingtag" would be a better choice? |
Does HTML5 allow <p>paragraph one
<p>paragraph two without a previous closing </p></p> ? Do we want to allow that? It sounds like "ontagerror" would cause the error - but also errors on |
Another option is to use the "Xhtml" instead of "xml" module in po4a. It correctly deals with those tags without adding options but segments the paragraphs in a completely different way, meaning translators would have to re-translate "1-Index.html", though it seems a re-write is in the works so maybe not such a big deal. Here's an issue raised about the same problem that arose with the Xhtml module, but which seems to have been solved since. |
HTML void elements should not use trailing slashes: https://github.com/validator/validator/wiki/Markup-%C2%BB-Void-elements#trailing-slashes This removes (hopefully) all of them Note: SVG images do need them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all is ok now after the update by ignotus.
There's something wrong - all the file updates with po4a fail, but the script doesn't exit and the check looks like it passed when it didn't. Apparently |
Ok, fixed now. |
Aargh, this has caused Weblate to lock due to a whole load of conflicts... |
Short description of changes
HTML void elements should not use trailing slashes: https://github.com/validator/validator/wiki/Markup-%C2%BB-Void-elements#trailing-slashes
This removes (hopefully) all of them
Context: Fixes an issue? Related issues
Makes w3c validator happy
Status of this Pull Request
Ready for review.
What is missing until this pull request can be merged?
Review
Does this need translation?
No.
Checklist