mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 12:24:46 +08:00
Strip citation prefix in citation badges
This commit is contained in:
@@ -17,7 +17,10 @@ export function CitationLink({
|
|||||||
const domain = extractDomain(href ?? "");
|
const domain = extractDomain(href ?? "");
|
||||||
|
|
||||||
// Priority: children > domain
|
// Priority: children > domain
|
||||||
const childrenText = typeof children === "string" ? children : null;
|
const childrenText =
|
||||||
|
typeof children === "string"
|
||||||
|
? children.replace(/^citation:\s*/i, "")
|
||||||
|
: null;
|
||||||
const isGenericText = childrenText === "Source" || childrenText === "来源";
|
const isGenericText = childrenText === "Source" || childrenText === "来源";
|
||||||
const displayText = (!isGenericText && childrenText) ?? domain;
|
const displayText = (!isGenericText && childrenText) ?? domain;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user