Skip to content

Commit d75405f

Browse files
author
Willy Hardy
committed
create tableString
1 parent d80aa21 commit d75405f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/plugins/search/search.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ export function genIndex(path, content = '', router, depth) {
6868
index[slug] = {slug, title: '', body: ''}
6969
} else if (index[slug].body) {
7070
index[slug].body += '\n' + (token.text || '')
71+
} else if (token.type === 'table'){
72+
var tableString = '|';
73+
token.cells.forEach(function (rows) {
74+
rows.forEach(function(cell) {
75+
tableString += ' ' + cell + ' |';
76+
});
77+
});
78+
index[slug].body = tableString;
7179
} else {
7280
index[slug].body = token.text
7381
}

0 commit comments

Comments
 (0)