From 970f3be8d47f2b05e35ba72e8a5ee776614f1211 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sat, 11 Feb 2017 09:34:46 +0800 Subject: [PATCH] fix(search): crash when not content, fixed #68 --- src/plugins/search.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/search.js b/src/plugins/search.js index 3e9a5ee82..17aff3409 100644 --- a/src/plugins/search.js +++ b/src/plugins/search.js @@ -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] = {}