Skip to content

HTML structure audit rules

View as Markdown

Sonjoo groups 12 checks under HTML structure (htmlval). Select this category with sonjoo audit <url> --categories htmlval, or pass the category ID in an HTTP audit request.

This category has weight 2 in the overall audit score when it has scored results. Sonjoo normalizes category weights over the categories with scored results.

All audit categories · Rule settings and interpretation

Require the modern HTML doctype at the start of a document, after permitted comments or ASCII whitespace. The optional about:legacy-compat system identifier is valid for HTML generators.

Inputs. HTML source was collected.

Evidence. Presence and actionable HTML doctype instruction.

Base scoring weight 15 when measured.

Identify nonempty HTML encoding declarations in head, distinguish transport-only encoding, and fail when no declaration is available.

Inputs. HTML source was collected.

Evidence. Encoding method and declared value when present.

Base scoring weight 15 when measured.

Report body content explicitly placed in a source head. Inline script text and templates do not place their tag-like contents directly in head.

Inputs. HTML source was collected.

Evidence. Invalid source element names and distinct count.

Base scoring weight 10 when measured.

Check that head noscript contains only metadata allowed by the head-specific noscript content model.

Inputs. HTML source was collected.

Evidence. Distinct disallowed element names and count.

Base scoring weight 5 when measured.

Count explicit head declarations without counting markup in comments or script strings; flag more than one.

Inputs. HTML source was collected.

Evidence. Number of explicit head start tags.

Base scoring weight 10 when measured.

Measure UTF-8 bytes of the collected HTML string and report size tiers for delivery overhead.

Inputs. HTML source was collected.

Evidence. Measured byte size and crossed tier.

Base scoring weight 8 when measured.

Flag explicit conventional lorem-ipsum phrases in visible body copy.

Inputs. HTML source was collected.

Evidence. Matched phrases as source text.

Base scoring weight 5 when measured.

Count HTML document titles, excluding titles in SVG and MathML namespaces, with no more than one permitted.

Inputs. HTML source was collected.

Evidence. HTML title count and conflicting titles.

Base scoring weight 12 when measured.

Count description metadata names case-insensitively and fail when more than one is present.

Inputs. HTML source was collected.

Evidence. Count and duplicate description values.

Base scoring weight 10 when measured.

Report document title elements placed outside the metadata head; ignore titles in SVG and MathML namespaces.

Inputs. HTML source was collected.

Evidence. Number of misplaced titles and their text.

Base scoring weight 12 when measured.

Check authored base href values and detect competing base elements. A single HTTP(S) or resolvable relative base is valid.

Inputs. HTML source was collected.

Evidence. Authored base hrefs and problem reason.

Base scoring weight 6 when measured.

Check for multiple explicit body start tags, a body before html, or substantive content before an explicitly authored head.

Inputs. HTML source was collected.

Evidence. Specific source-order defect and source offset.

Advisory. Excluded from scoring.