Skip to contentSkip to conversation

Fix HTML issues discovered with the W3 HTML validator

PATCH Applied Thomas Huth 2 participants 6 messages Feb 7, 2017

lore
Share & tools
lore
#0 lore raw

cover Fix HTML issues discovered with the W3 HTML validator

The W3 HTML validator (https://validator.w3.org/) complains about missing "alt" attributes and a missing "</section>" tag for the new QEMU website. Here are two patches to fix the issues.

Thomas Huth (2):
Add missing HTML tag to close the screenshots section Add "alt" attributes to the img tags

 _includes/screenshot.html | 2 +-
 index.html                | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 Add missing HTML tag to close the screenshots section

The final "</section>" tag is missing here.

---
 index.html | 1 +
 1 file changed, 1 insertion(+)
index.html +1 -0
index cf31912..ab33b8a 100644
@@ -59,6 +59,7 @@ $('.colorbox').on("click.random-namespace", function() {
 })
 </script>
 
+			</section>
 		</div>
 		<hr>
 		<p>QEMU is a member of <a href="http://wiki.qemu-project.org/Conservancy">Software Freedom Conservancy</a>.</p>
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 Add "alt" attributes to the img tags

In reply to Thomas Huth

The "alt" attribute is mandatory for the img tags according to the HTML standard, so we need this to get valid HTML.

---
 _includes/screenshot.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
_includes/screenshot.html +1 -1
index 3f85791..70b0d11 100644
@@ -5,5 +5,5 @@
    else %}{{screenshot.description}}{%endif %}{%
    if screenshot.author %} {{screenshot.author | markdownify | remove: '<p>' | remove: '</p>' | strip_newlines | escape}} {% endif %}{%
    if screenshot.source %} (&lt;a href=&quot;{{screenshot.source}}&quot;&gt;Source&lt;/a&gt;){%endif %}"><img
-   src="screenshots/{{screenshot.file}}"/></a>
+   src="screenshots/{{screenshot.file}}" alt="Screenshot: {{screenshot.description}}"/></a>
 {% endfor %}
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Thomas Huth
Quoted 4 lines · Thomas Huth

The W3 HTML validator (https://validator.w3.org/) complains about missing "alt" attributes and a missing "</section>" tag for the new QEMU website. Here are two patches to fix the issues.

Quoted 8 lines

Thomas Huth (2):
Add missing HTML tag to close the screenshots section Add "alt" attributes to the img tags

 _includes/screenshot.html | 2 +-
 index.html                | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Applied, thanks! :)

Paolo

#4 lore raw
Quoted 11 lines · Paolo Bonzini
Quoted 8 lines · Thomas Huth

The W3 HTML validator (https://validator.w3.org/) complains about missing "alt" attributes and a missing "</section>" tag for the new QEMU website. Here are two patches to fix the issues.

Thomas Huth (2):
Add missing HTML tag to close the screenshots section Add "alt" attributes to the img tags

Quoted 6 lines
Quoted 4 lines
 _includes/screenshot.html | 2 +-
 index.html                | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Applied, thanks! :)

There is another error reported by the validator on the blog page:

https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.qemu-project.org%2Fblog%2F

But I don't have a clue how to fix that one ... the space in the URL should be translated to %20 - any ideas how to do that with Jekyll?

Thomas

#5 lore raw
Quoted 17 lines · Thomas Huth
Quoted 16 lines · Paolo Bonzini
Quoted 12 lines · Thomas Huth

The W3 HTML validator (https://validator.w3.org/) complains about missing "alt" attributes and a missing "</section>" tag for the new QEMU website. Here are two patches to fix the issues.

Thomas Huth (2):
Add missing HTML tag to close the screenshots section Add "alt" attributes to the img tags

 _includes/screenshot.html | 2 +-
 index.html                | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Quoted 8 lines
Quoted 1 line

Applied, thanks! :)

There is another error reported by the validator on the blog page:

https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.qemu-project.org%2Fblog%2F

But I don't have a clue how to fix that one ... the space in the URL should be translated to %20 - any ideas how to do that with Jekyll?

No idea, the best would probably be to make the category page "web_site" instead of "web site".

Paolo