From 234d826d3a95415490c3c534a5c460ad3e2c7f86 Mon Sep 17 00:00:00 2001 From: Ovler <86chengyujin@gmail.com> Date: Sat, 5 Feb 2022 23:36:49 +0800 Subject: [PATCH] fix typo --- pages/api/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/search.ts b/pages/api/search.ts index 0edae83..f7c07f9 100644 --- a/pages/api/search.ts +++ b/pages/api/search.ts @@ -12,8 +12,8 @@ import siteConfig from '../../config/site.config' * @returns Sanitised query string which replaces non-alphanumeric characters with ' ' */ function sanitiseQuery(query: string): string { -/** const sanitisedQuery = query.replace(/[^a-zA-Z0-9]/g, ' ') - * Actually this will cause problems with CJK only query words as it will remove every character. + const sanitisedQuery = query +/** Actually this will cause problems with CJK only query words as it will remove every character. * After removing it, CJK search will be much improved. */ return encodeURIComponent(sanitisedQuery)