mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 05:16:06 +10:00
fix: searching table content
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user