Skip to content

Conversation

@HugoHSun
Copy link

@HugoHSun HugoHSun commented Jan 2, 2026

PR App Fix RM-13097

🧰 Changes

GFM's autolink feature converts URL-like text (e.g., "https://example.com") into link nodes, which creates invalid nested links when the text is inside an component with extra attributes like target="_blank".

Changes:

  • Unwrap nested link nodes in readme-components.ts during MDAST transformation
  • Unwrap nested elements in Anchor.tsx during React rendering
  • Add link compiler tests for the nested link edge case
  • Add Anchor component tests for unwrapping behavior

Fixes the bug where links with URL-like labels and "Open in new tab" setting would display as nested links after page reload.

Related: readmeio/readme#16851

🧬 QA & Testing

GFM's autolink feature converts URL-like text (e.g., "https://example.com")
into link nodes, which creates invalid nested links when the text is inside
an <Anchor> component with extra attributes like target="_blank".

Changes:
- Unwrap nested link nodes in readme-components.ts during MDAST transformation
- Unwrap nested <a> elements in Anchor.tsx during React rendering
- Add link compiler tests for the nested link edge case
- Add Anchor component tests for unwrapping behavior

Fixes the bug where links with URL-like labels and "Open in new tab" setting
would display as nested links after page reload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants