Skip to main content

require-ancestor

Warns when an element appears without a required ancestor its content model specifies (descendantOf), according to the HTML Living Standard. It has settings in @markuplint/html-spec.

❌ Examples of incorrect code for this rule

<div>
<area href="/path" alt="Link" />
</div>

✅ Examples of correct code for this rule

<map name="example">
<area href="/path" alt="Link" />
</map>

Interface

{
"require-ancestor": boolean
}

Default Severity

error