Skip to content

fix(elements): prevent invalid citation URL from crashing message render - #463

Open
ephraimduncan wants to merge 1 commit into
vercel:mainfrom
ephraimduncan:fix/inline-citation-invalid-url
Open

fix(elements): prevent invalid citation URL from crashing message render#463
ephraimduncan wants to merge 1 commit into
vercel:mainfrom
ephraimduncan:fix/inline-citation-invalid-url

Conversation

@ephraimduncan

Copy link
Copy Markdown

A citation source like example.com/nlp, /docs/setup, or other non-absolute model output previously threw TypeError: Invalid URL during render, unmounting the entire message containing the citation instead of just degrading the badge. InlineCitationCardTrigger now guards the hostname parse with URL.canParse: valid absolute URLs still show their hostname, unparseable non-empty sources fall back to the raw string as the badge label, and the empty-source "unknown" fallback is unchanged.

Added three render tests (bare domain, relative path, non-URL string) asserting the render doesn't throw and the fallback label appears; 29/29 pass in Chromium.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@ephraimduncan is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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