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 a70df7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 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,7 @@ 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 hash = linkHash ? `#${linkHash.split("#").slice(1).join("#")}` : "";
let $sectionElements;
if ($(heading).parents(".markdown").length === 0) {
// $(heading) is the page title
Expand Down

0 comments on commit a70df7b

Please sign in to comment.