Skip to content

Fix unstyled link flash in external link cards#2407

Open
tf wants to merge 1 commit intocodevise:masterfrom
tf:teaser-link-improvements
Open

Fix unstyled link flash in external link cards#2407
tf wants to merge 1 commit intocodevise:masterfrom
tf:teaser-link-improvements

Conversation

@tf
Copy link
Copy Markdown
Member

@tf tf commented Apr 24, 2026

Wrapping the whole card in an anchor broke SSR hydration when the card contained other links (file-rights credits or inline description links): the HTML parser auto-closes the outer anchor when it sees a nested one, producing a different DOM than React renders, so cards briefly appeared without link styling until hydration completed.

Replace the outer anchor with one of three inner links chosen by card content: the title when present, the image when the card shows only a thumbnail, or a visually hidden "More" fallback otherwise. Each inner link is a sibling of any other anchor, so the markup is valid and hydration is seamless.

Inline description links now work without the outer anchor hijacking drags or forcing nested anchors. Editor mode keeps the outer EditableLink wrapper so the link action button behaves as before.

Wrapping the whole card in an anchor broke SSR hydration when the
card contained other links (file-rights credits or inline description
links): the HTML parser auto-closes the outer anchor when it sees a
nested one, producing a different DOM than React renders, so cards
briefly appeared without link styling until hydration completed.

Replace the outer anchor with one of three inner links chosen by
card content: the title when present, the image when the card shows
only a thumbnail, or a visually hidden "More" fallback otherwise.
Each inner link is a sibling of any other anchor, so the markup is
valid and hydration is seamless.

Inline description links now work without the outer anchor hijacking
drags or forcing nested anchors. Editor mode keeps the outer
EditableLink wrapper so the link action button behaves as before.
@tf tf force-pushed the teaser-link-improvements branch from d9ccd74 to 2a3e64b Compare April 24, 2026 14:56
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.

1 participant