Skip to content

Commit

Permalink
chore: adjust Hash link parser for Docusaurus version 3 cr suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamauri committed Aug 13, 2024
1 parent e6fa809 commit 681eeee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-search-local/src/server/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export function html2text(
.not("a[aria-hidden=true], a.hash-link")
.text();
const linkHash = $(heading).find("a.hash-link").attr("href") || "";
const [, hashPart] = linkHash.split("#");
const hash = hashPart ? `#${hashPart}` : "";
const [, ...hashParts] = linkHash.split("#");
const hash = hashParts.length ? `#${hashParts.join("#")}` : "";
let $sectionElements;
if ($(heading).parents(".markdown").length === 0) {
// $(heading) is the page title
Expand Down

0 comments on commit 681eeee

Please sign in to comment.