Skip to content

fix(markdown): remove underlined space inside anchors wrapping images - #3146

Open
Naitik-Goyal-0903 wants to merge 1 commit into
primer:mainfrom
Naitik-Goyal-0903:fix/markdown-anchor-underline
Open

fix(markdown): remove underlined space inside anchors wrapping images#3146
Naitik-Goyal-0903 wants to merge 1 commit into
primer:mainfrom
Naitik-Goyal-0903:fix/markdown-anchor-underline

Conversation

@Naitik-Goyal-0903

Copy link
Copy Markdown

What are you trying to accomplish?

This PR fixes the issue where whitespace inside <a> tags wrapping <img> tags renders as an underlined gap in .markdown-body.

Fixes #3128

What approach did you choose and why?

Added display: inline-flex to a[href]:has(img) inside .markdown-body. This removes unnecessary whitespace painting under anchor tags wrapping images without affecting adjacent elements.

What should reviewers focus on?

Please verify that anchor tags with nested images render correctly without unwanted underlines, and that adjacent elements retain their normal layout.

Can these changes ship as is?

  • Yes, this PR does not depend on additional changes. 🚢

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 603de00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

.markdown-body: whitespace inside <a> wrapping <img> renders as underlined space

1 participant