-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
It does not search inside tables #582
Comments
Hii again I am not an expert on javascript, but I have found a not very pretty solution. I am not sure if it is correct, but it works better than before. I have changed getIndex() function:
Maybe someone could improve it and check if it works as it should. Thankssss :)) |
function genIndex(path, content, router, depth) {
if ( content === void 0 ) content = '';
var tokens = window.marked.lexer(content);
var slugify = window.Docsify.slugify;
var index = {};
var slug;
tokens.forEach(function (token) {
if (token.type === 'heading' && token.depth <= depth) {
slug = router.toURL(path, {id: slugify(token.text)});
index[slug] = {slug: slug, title: token.text, body: ''};
} else {
if (!slug) {
return
}
if (!index[slug]) {
index[slug] = {slug: slug, title: '', body: ''};
} else {
if(!token.text){
if(token.type === 'table'){
token.text = '';
token.cells.forEach(function (rows) {
rows.forEach(function(cell) {
token.text += cell + '\n';
});
});
}
}
index[slug].body = (index[slug].body ? index[slug].body + token.text : token.text) + '\n';
}
}
});
slugify.clear();
return index
} this is my code, the real problem is token.text not exist when token.type === 'table' |
One year later bug still exist :( |
Just confirming that there is no fix for this. |
I would also like to see this fixed. |
I think I've made a fix at least for tables based on @saioaRed code I'll submit a pull request. |
Awesome thank you. |
@rbpclub Any update on this PR? I am really interested in getting this feature in. |
Hey Sorry, I just realized I commented from an alt account. I am working on the PR. |
Any update on this issue being fixed by the PR? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi :)
I find out that the search tool doesn't search inside a table and I have texts inside them that need to be searchable.
Is this an issue? Or is it something that I am missing?
This is my search configuration:
By the way, I love Docsify, it makes my life easier :))))
The text was updated successfully, but these errors were encountered: