fix: searching table content

This commit is contained in:
Luffy
2020-02-07 23:39:46 +05:30
committed by GitHub
parent 90a35ab952
commit 6184e50262
+9 -1
View File
@@ -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 ')
}
}
index[slug].body = (index[slug].body ? index[slug].body + token.text : token.text)
}
}
})