From 7e697d1857ccb6b80ec9fee5df04154c6b05a1c0 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 18 Jan 2022 21:31:16 +0000 Subject: [PATCH] Remove marker function --- assets/ts/search.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/assets/ts/search.tsx b/assets/ts/search.tsx index 495961d..a7a220b 100644 --- a/assets/ts/search.tsx +++ b/assets/ts/search.tsx @@ -169,6 +169,7 @@ class Search { result.preview = Search.processMatches(result.content, contentMatches); } else { + /// If there are no matches in the content, use the first 140 characters as preview result.preview = replaceHTMLEnt(result.content.substring(0, 140)); } @@ -176,16 +177,12 @@ class Search { if (result.matchCount > 0) results.push(result); } - /** Result with more matches appears first */ + /// Result with more matches appears first return results.sort((a, b) => { return b.matchCount - a.matchCount; }); } - public static marker(match) { - return '' + match + ''; - } - private async doSearch(keywords: string[]) { const startTime = performance.now();