Duolith docs

Errors while checking a page

E0181 Heading level that is not a heading's depth

Message level is a heading's depth, written as text from "1" to "6"

Why

A text with role="heading" may say how deep it is with level, from "1" for the page's own heading to "6". On the web a levelled heading is written as h1 to h6, which search engines and screen readers read as the page's outline (decision 0162). The tag is chosen when the app is built, so level is written as text, and it means something only on a heading.

How to fix it

Write <text role="heading" level="1"> for the page's own heading and level="2" for the sections under it. On a text that is not a heading, remove level or add role="heading".

In a terminal

duolith explain E0181

Mentioned in