-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cannot search for 1-level heading content #1828
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -119,7 +119,7 @@ function generateSearchMetadata( | |||
const tocSections = routeMeta.toc.reduce<ISearchMetadata[0]['sections']>( | |||
(acc, toc, i) => { | |||
// exclude demo id, to avoid duplicate | |||
if (!demoIds.includes(toc.id) && toc.depth > 1) { | |||
if (!demoIds.includes(toc.id) && toc.depth >= 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,这里已调整,就是在匹配toc
的 title
的时候,看下是否能匹配页面title
, 如果是的话就跳过。就等于过滤掉toc
的搜索结果
e40b315
to
e6e2c36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
🤔 这个变动的性质是?/ What is the nature of this change?
🔗 相关 Issue / Related Issue
#1811
💡 需求背景和解决方案 / Background or solution
searchWorker.ts
格式化搜索内容 层级少了一层📝 更新日志 / Changelog