mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-25 23:14:46 +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>;
|
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);
|
const citation = citationMap.get(href);
|
||||||
if (citation) {
|
if (citation) {
|
||||||
return (
|
return (
|
||||||
@@ -323,19 +323,14 @@ export function ArtifactFilePreview({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if it's an external link (http/https)
|
// All other links (including project URLs) render as plain links
|
||||||
const isExternalLink =
|
|
||||||
href.startsWith("http://") || href.startsWith("https://");
|
|
||||||
|
|
||||||
if (isExternalLink) {
|
|
||||||
return (
|
|
||||||
<CitationLink href={href}>{children}</CitationLink>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Internal/anchor link
|
|
||||||
return (
|
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}
|
{children}
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user