richie icon indicating copy to clipboard operation
richie copied to clipboard

Invalid HTML from some pages

Open sveetch opened this issue 2 years ago • 0 comments

Bug Report

Expected behavior/code

Richie rendered pages should be free from any invalid HTML markup.

By invalid, i mean against the Nu Html Checker which is to be considered as the reference (this is the official checker from W3C).

Actual Behavior

Here is the resume of reported errors:

  1. When the srcset attribute has any image candidate string with a width descriptor, the sizes attribute must also be present
    • On homepage;
    • Category detail page;
    • Organization detail page;
    • Person detail page;
    • Program detail page;
    • About page (the demo version which is alike a sandbox with some various plugins usages);
    • Finally this appears on page which have course and organizations glimpses.
  2. Element <meta> not allowed as child of dl tag in this context.
    • Only on course detail pages which have course run sessions (involved <dl> is the session list);

There is also some warnings but i won't report them here since they are not so much important. From memory this is almost about some <section> missing title tag (h1, h2, ..), something which only matters for SEO in some context.

Steps to Reproduce

  1. Open the Nu Html Checker;
  2. Use a Richie site which is reachable from internet;
  3. Get page urls for stated list of invalid html previously listed. Some few pages may be exempted from any error because they do not include the faulty contents;
  4. See the error report.

Environment

  • Richie version: Current unreleased version (almost all reported errors was present before but some of them have been corrected recently)
  • Platform: Any

Possible Solution

For the srcset error, it is "simply" needed to add missing attribute sizes however the srcset feature is a little bit complex to correctly configure. Maybe other template fragment that did it well can be a source of inspiration.

For the <meta> error, i'm not very sure about this since WHATWG specification defines that <meta> tag with attribute itemprop is allowed almost anywhere but in Richie they do not have this attribute (they have property instead) so there should be other reported errors for <meta> inside div.course-detail__content element. So i don't know if it is totally invalid (with property attribute usage only) or just for inside some block like <dl>.

sveetch avatar Mar 23 '22 00:03 sveetch