Skip to content

Commit

Permalink
fix: skip code blocks in search index (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 authored Nov 27, 2023
1 parent 2b8f4fe commit cfbae4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-beans-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rspress/core': patch
---

fix: skip code blocks in search index
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export async function extractPageData(
selector: 'img',
format: 'skip',
},
{
// Skip code blocks
selector: 'pre > code',
format: 'skip',
},
...['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map(tag => ({
selector: tag,
options: {
Expand Down

0 comments on commit cfbae4f

Please sign in to comment.