Skip to content

Commit

Permalink
fix: ignore signature title in searches
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyrota committed Nov 13, 2021
1 parent 0637825 commit 656097b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion www/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ function extractTextRegions(
const onlyChild = childNode.children[0];
if (onlyChild.type === CoreNodeType.PlainText) {
if (
onlyChild.text === 'Signature' ||
onlyChild.text === 'Parameters' ||
onlyChild.text === 'Returns' ||
onlyChild.text === 'Example Usage'
Expand All @@ -135,6 +134,21 @@ function extractTextRegions(
}
}
}
// Signature title has more than one child
if (
childNode.type === CoreNodeType.Title &&
childNode.children.length === 2
) {
const firstChild = childNode.children[0];
const secondChild = childNode.children[1];
if (
firstChild.type === CoreNodeType.PlainText &&
firstChild.text === 'Signature - ' &&
secondChild.type === CoreNodeType.GithubSourceLink
) {
continue;
}
}
extractTextRegions(childNode, textRegions, documentTitle);
}
}
Expand Down

1 comment on commit 656097b

@vercel
Copy link

@vercel vercel bot commented on 656097b Nov 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.