layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Bug][Handbook] Fix invalid nested anchor tags and whitespace IDs in Handbook pages

Open vasakb opened this issue 4 days ago β€’ 2 comments

Description

In several community handbook MDX files (such as projects/index.mdx and contribution/index.mdx), headings wrap an outer <a id="..."> tag around an <h3> that contains an inner <a href="..."> link.

Affected live pages:

  • https://layer5.io/community/handbook/projects
  • https://layer5.io/community/handbook/contribution

For example, in src/collections/handbook/projects/index.mdx:

<a id="Layer5"><h3 className="heading-top"><a href="https://layer5.io/"><img className="project-title-icon" src={layer5icon} alt="Layer5" />&nbsp; Layer5</a></h3></a>

Why is this an issue?

  1. Invalid HTML & React warning: HTML5 and React prohibit nested <a> tags (validateDOMNesting: <a> cannot appear as a descendant of <a>). Browsers automatically force-close the outer anchor, breaking the DOM hierarchy and click targets.
  2. Whitespace in IDs: Heading IDs such as id="Cloud Native Performance" and id="Clone your fork" contain spaces, which is invalid HTML for IDs and causes table of contents anchor jumping to misbehave.

Affected Files

  • src/collections/handbook/projects/index.mdx
  • src/collections/handbook/contribution/index.mdx
  • Related handbook navigation links, where applicable

Expected Behavior

  • The target IDs should be placed directly on the heading elements (e.g. <h3 id="layer5" className="heading-top">).
  • Redundant outer <a> wrapper tags should be removed.
  • Anchor links in the TOC frontmatter should match valid IDs without spaces, using lowercase kebab-case (e.g. cloud-native-performance).

Proposed approach

  • Move IDs onto the heading elements (lowercase kebab-case).
  • Remove the redundant outer <a> wrappers.
  • Update TOC frontmatter and grep the repo for references to the old IDs, updating any that are found.
  • Run the dev server and verify that the validateDOMNesting warning is gone and every TOC link scrolls to the right heading.

I would like to work on this. Please assign it to me!

Screenshots

(Attach your screenshot of the console warning or broken anchor here)

Screenshot 2026-12-01 at 7 58 46β€―AM

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Join the Layer5 Community by submitting your community member form.

vasakb avatar Dec 01 '26 02:12 vasakb

Hi @piyushtripathi9424 @tejaswiverma121-byte i would like to work on this issuse could you please assign this to me !!

vasakb avatar Dec 01 '26 02:12 vasakb

Thank you @piyushtripathi9424 for assigning this issue for me ill raise the PR soon !!

vasakb avatar Dec 01 '26 04:12 vasakb