From e99ccc4f796da8a8b9d3eb849bc3904d2fd9a989 Mon Sep 17 00:00:00 2001 From: wassname Date: Sat, 24 Feb 2024 08:39:21 +0800 Subject: [PATCH] popup on citations too --- web/src/components/citations.tsx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/web/src/components/citations.tsx b/web/src/components/citations.tsx index 8dc06bc..3eb1b7b 100644 --- a/web/src/components/citations.tsx +++ b/web/src/components/citations.tsx @@ -71,7 +71,8 @@ export const ShowCitation: React.FC<{ citation: Citation }> = ({ citation, }) => { var c_str = citation.title; - + const split = citation.text.split('"""'); + const text = split.length === 1 ? citation.text : split[1]; if (citation.authors && citation.authors.length > 0) c_str += " - " + citation.authors.join(", "); if (citation.date && citation.date !== "") c_str += " - " + citation.date; @@ -83,16 +84,18 @@ export const ShowCitation: React.FC<{ citation: Citation }> = ({ : `https://duckduckgo.com/?q=${encodeURIComponent(citation.title)}`; return ( - - [{citation.index}] -

{c_str}

-
+ + + [{citation.index}] +

{c_str}

+
+
); }; @@ -121,7 +124,7 @@ export const CitationRef: React.FC<{ citation?: Citation }> = ({ citation, }) => { if (!citation) return null; - + const split = citation.text.split('"""'); const text = split.length === 1 ? citation.text : split[1]; const url =