tgdwyer / tgdwyer.github.io

Apps and Demos
MIT License
32 stars 46 forks source link

Chapters are in quirks mode & incorrect header #124

Closed Klaaktu closed 4 weeks ago

Klaaktu commented 2 months ago

When inside chapter pages, e.g. https://tgdwyer.github.io/levelsofabstraction/, the browser says:

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.

The header of the chapter pages seem incorrect comparing to the home page, with the <!DOCTYPE html>, lang=en missing, and all the tags that are supposed to be in the <head></head> inside <body> instead.

p.s. But anyway this seems to be a trivial issue, nothing seems broken.

Klaaktu commented 1 month ago

https://github.com/tgdwyer/tgdwyer.github.io/blob/3dd30064eb56f6cba561752f9db4bd5f568cb801/_plugins/glossary.rb#L62 If I replace this with doc = Nokogiri::HTML5.parse(content) the issue goes away. The function is passed the entire document, HTML.fragment() will strip the tags: https://nokogiri.org/rdoc/Nokogiri/HTML5.html#module-Nokogiri::HTML5-label-Notes p.s. The documentation for Nokogiri::HTML4 (aliased HTML) is lacking, only HTML5 says so.