fix: search does not find the contents of the table#1198
fix: search does not find the contents of the table#1198anikethsaha merged 2 commits intodocsifyjs:developfrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/qfd7yuok4 |
|
Is now okay? @anikethsaha |
|
remove the scope, Also, change the commit message as well. |
There was a problem hiding this comment.
Good Job. 👍
Litte suggestion.
I think this block could refine.
if (!token.text && token.type === 'table') {
token.text = token.cells
.map(function(rows) {
return rows.join(' | ');
})
.join(' |\n ');
}
index[slug].body += '\n' + (token.text || '');
} else {
if (!token.text && token.type === 'table') {
token.text = token.cells
.map(function(rows) {
return rows.join(' | ');
})
.join(' |\n ');
}
index[slug].body = index[slug].body
? index[slug].body + token.text
: token.text;
}what the the difference is solving the index[slug].body.
it seems too much duplicate here.
if (!token.text && token.type === 'table') {
token.text = token.cells
.map(function(rows) {
return rows.join(' | ');
})
.join(' |\n ');
}|
and I prefer to use |
nah, it's okay. |
|
is there any issue which is being fixed by this PR ? feel free to close that one |
|
No relevant issue. I found the problem, fixed it by the way. |
|
great |
Summary
The previous commit #1015 only fixed the situation where there was no content before the table. like this:
But this one below is not searchable.
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx], where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
libdirectory.