Skip to content

Commit 3c0c701

Browse files
committed
Use startsWith
1 parent 73650a9 commit 3c0c701

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/frontend/src/components/Answer/AnswerParser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function isCitationValid(contextDataPoints: any, citationCandidate: string): boo
2323
return false;
2424
}
2525

26-
// Check if the citation is included in any of the strings within the text array
27-
const isValidCitation = dataPointsArray.some(dataPoint => dataPoint.includes(citationCandidate));
26+
// Check if dataPoint starts with citation
27+
const isValidCitation = dataPointsArray.some(dataPoint => dataPoint.startsWith(citationCandidate));
2828

2929
if (!isValidCitation) {
3030
return false;

0 commit comments

Comments
 (0)