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 trailing slash from closing tag #480
Conversation
According to https://validator.w3.org trailing slashes like these should not be used: "Trailing slash on void elements has no effect and interacts badly with unquoted attribute values" It's just an INFO message, but doesn't hurt to adhere to the recommendation I think.
Hi potaito, |
We can kindly ask @ashmaroli and @mattr- to take a look. They probably just didn't get around to it yet. I'm not a maintainer, so I can't do more than open a PR. |
Ok thank you! |
Hello everyone, Since, removing the slash from the closing tags will be a breaking change for users with XHTML templates, I am not willing to merge this right away. I am however, open to accept this when there is significant evidence to favor the move. |
Hi ashmaroli, Thanks you for the reply. You're right, this change isn't XHTML compatible. However, can you tell me an example of "breaking change for users with XHTML templates"? My understanding is that this plugin is for Jekyll that is built to create static website. Static websites are visible thorugh browsers. All browsers support HTML 5 and previous versions that, according to the W3C standard uses void elements like meta, link, img that don't expect content inside so they don't need closing tag. As far as I know latest XHTML version was 2.0 which was under development for several years but was never completed or released. This version of XHTML was eventually abandoned in favor of a new approach called HTML5. I don't want convince anyone, I just want to understand what's wrong with my reasoning. |
Say, I have a site configured with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{% seo %}
</head>
<body>
{{ content }}
</body>
</html> It wouldn't be wise for |
Just a question: are there people out there wrinting web pages with these specification?
Why not HTML 5? |
At this point, why not an option to remove the trailing slash on void elements (meta, link, img, etc.) for HTML standard? |
I personally doubt there are any, in this day and age. |
Because it is sub-optimal. The options are to either maintain two separate templates or introduce numerous |
Thanks for the explanation @ashmaroli . I have not considered XHTML when I proposed this. |
Ok thank you @ashmaroli for explanation. Your tool is generic and make sense support both the standards. |
Hi @ashmaroli, You already explained that this fix cannot be done on your side. I agree with you. I am not a Jekyll expert, especially in Plugin write. Is there any code I can write on my side just to override your implementation for meta and links tags? |
@sasadangelo Out-of-the-box, there is no support for a custom template.
Eventually, if you feel the need to make more changes to the plugin, you can fork this repository, commit all desired changes to a branch and edit the Gemfile to point to that branch instead. |
Hi ashmaroli, Thank you for your reply. Yes this is a thing I thought. My question is if it is possible add a piece of ruby code on plugins folder just to override meta and link tags. |
Unfortunately @sasadangelo, that is not an option since the change you require is in a Liquid template. |
|
According to https://validator.w3.org trailing slashes like these should not be used:
"Trailing slash on void elements has no effect and interacts badly with unquoted attribute values"
It's just an INFO message, but doesn't hurt to adhere to the recommendation I think. Below is an example Screenshot of the results I get when validating a page generated with jekyll and jekyll-seo-tag:
Test
I tested the changes locally and re-uploaded the generated HTML file to the validator. The w3 validator was happy :)