fix(search): crash when not content, fixed #68

This commit is contained in:
qingwei.li 2017-02-11 09:34:46 +08:00 committed by cinwell.li
parent 50f5fc2b22
commit 9d3cc89aa9

View File

@ -76,6 +76,7 @@ const genIndex = function (path, content = '') {
slug = `#/${path}#${id}`.replace(/\/+/, '/')
INDEXS[slug] = { slug, title: text, body: '' }
} else {
if (!slug) return
// other html tag
if (!INDEXS[slug]) {
INDEXS[slug] = {}