Skip to content

Z121: MISSING_OR_EMPTY_HREF

  • Severity: Error


    Penalty: 0.0 points | Category: general

  • Remediation & Opt-In


    Auto-Fixable: No | Opt-In: No


Rationale

Emitted when an HTML <a> tag lacks an href attribute or has an empty href="" string, forming an invalid link element.


How to Fix

Provide a valid relative or absolute target URL in the href attribute.

  • Failing Pattern (Triggers Z121)


    docs/example.md
    <a href="">Empty Link</a>
    <a>Missing Href</a>
    
  • Passing Pattern (Resolves Z121)


    docs/example.md
    <a href="/guide">Valid Link</a>
    

Reference

See the Finding Codes Index for finding code details.