Skip to content

fix #582 and #824 #1015

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

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/plugins/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ export function genIndex(path, content = '', router, depth) {
} else if (index[slug].body) {
index[slug].body += '\n' + (token.text || '')
} else {
index[slug].body = token.text
if (!token.text) {
if (token.type === 'table') {
token.text = token.cells.map(function (rows) {
return rows.join(' | ')
}).join(' |\n ')
}
}

Comment on lines +74 to +81
Copy link
Member

Choose a reason for hiding this comment

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

This is from #582 right ?
I guess we should wait for his response for a while if its inactive then we can work here

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but I need to use it. I'm not sure what problems will be caused by this modification, and I can't find it after adding some descriptions mentioned in the test case. How should I solve this?

Copy link
Member

@anikethsaha anikethsaha Feb 5, 2020

Choose a reason for hiding this comment

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

These changes look fine to me, and I think it won't break anything else.

cc @docsifyjs/core , can you guys review this

index[slug].body = (index[slug].body ? index[slug].body + token.text : token.text)
}
}
})
Expand Down