Strip citation prefix in citation badges
This commit is contained in:
parent
1af14bf7e4
commit
f8e4fe05b2
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue