Skip to content

Commit

Permalink
deps: Update cheerio to 1.0.0
Browse files Browse the repository at this point in the history
Fixes: #218
Fixes: #219
Fixes: #224
  • Loading branch information
cmfcmf committed Nov 9, 2024
1 parent 23556bf commit 9ba4f13
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 45 deletions.
164 changes: 123 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/docusaurus-search-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@algolia/autocomplete-theme-classic": "^1.8.2",
"@algolia/client-search": "^4.12.0",
"algoliasearch": "^4.12.0",
"cheerio": "^1.0.0-rc.9",
"cheerio": "^1.0.0",
"clsx": "^1.1.1",
"lunr-languages": "^1.4.0",
"mark.js": "^8.11.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-search-local/src/server/parse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cheerio from "cheerio";
import * as cheerio from "cheerio";
import logger from "./logger";

// We insert whitespace after text from any of these tags
Expand Down Expand Up @@ -42,7 +42,7 @@ const BLOCK_TAGS = [
"th",
];

function _getText($: ReturnType<typeof cheerio.load>, el: any | any[]): string {
function _getText($: cheerio.CheerioAPI, el: any | any[]): string {
if (Array.isArray(el)) {
let content = "";
el.forEach((el) => {
Expand Down Expand Up @@ -71,7 +71,7 @@ function _getText($: ReturnType<typeof cheerio.load>, el: any | any[]): string {
}
}

function getText($: ReturnType<typeof cheerio.load>, el: any | any[]): string {
function getText($: cheerio.CheerioAPI, el: any | any[]): string {
return _getText($, el).replace(/\s+/g, " ").trim();
}

Expand Down

0 comments on commit 9ba4f13

Please sign in to comment.