mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 06:12:14 +08:00
fix(artifacts): only render citation badges for links in citationMap
Same fix as message-list-item: project URLs and regular links in artifact file preview should be rendered as plain links, not badges. Only actual citations (in citationMap) should be rendered as badges. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -313,7 +313,7 @@ export function ArtifactFilePreview({
|
||||
return <span>{children}</span>;
|
||||
}
|
||||
|
||||
// Check if it's a citation link
|
||||
// Only render as CitationLink badge if it's a citation (in citationMap)
|
||||
const citation = citationMap.get(href);
|
||||
if (citation) {
|
||||
return (
|
||||
@@ -323,19 +323,14 @@ export function ArtifactFilePreview({
|
||||
);
|
||||
}
|
||||
|
||||
// Check if it's an external link (http/https)
|
||||
const isExternalLink =
|
||||
href.startsWith("http://") || href.startsWith("https://");
|
||||
|
||||
if (isExternalLink) {
|
||||
return (
|
||||
<CitationLink href={href}>{children}</CitationLink>
|
||||
);
|
||||
}
|
||||
|
||||
// Internal/anchor link
|
||||
// All other links (including project URLs) render as plain links
|
||||
return (
|
||||
<a href={href} className="text-primary hover:underline">
|
||||
<a
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-primary underline underline-offset-2 hover:no-underline"
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user