Skip to content

Commit

Permalink
fix: parse h1 from the whole article
Browse files Browse the repository at this point in the history
When using singular `#` for setting a title of a Docusaurus document, it was not queried by the `docusaurus-search-local` since Docusaurus doesn't wrap `h1` in `header` in such cases.
  • Loading branch information
chernodub authored Mar 28, 2022
1 parent dadc30a commit aeb063a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/utils/parseDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getCondensedText } from "./getCondensedText";
const HEADINGS = "h1, h2, h3";

export function parseDocument($: cheerio.Root): ParsedDocument {
const $pageTitle = $("article header h1").first();
const $pageTitle = $("article h1").first();
const pageTitle = $pageTitle.text();

const sections: ParsedDocumentSection[] = [];
Expand Down

0 comments on commit aeb063a

Please sign in to comment.