Skip to content

Commit 23ba48d

Browse files
committed
fix: handle keywords stemmer, fix #487
1 parent f4e2a6d commit 23ba48d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docusaurus-search-local/src/server/utils/parseDocument.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("parseDocument", () => {
5555
{
5656
pageTitle: "Hello World",
5757
description: "Hello Description",
58-
keywords: "Hello,Keywords",
58+
keywords: "Hello, Keywords",
5959
sections: [
6060
{
6161
title: "Hello World",

docusaurus-search-local/src/server/utils/parseDocument.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export function parseDocument($: cheerio.Root): ParsedDocument {
99
const $pageTitle = $("article h1").first();
1010
const pageTitle = $pageTitle.text();
1111
const description = $("meta[name='description']").attr("content") || "";
12-
const keywords = $("meta[name='keywords']").attr("content") || "";
12+
const keywords = ($("meta[name='keywords']").attr("content") || "").replace(
13+
/,/g,
14+
", "
15+
);
1316

1417
const sections: ParsedDocumentSection[] = [];
1518
const breadcrumb: string[] = [];

0 commit comments

Comments
 (0)