Skip to content

Commit

Permalink
fix(search): crash when not content, fixed #68
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 11, 2017
1 parent c691b0e commit 345f7e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {}
Expand Down Expand Up @@ -296,6 +297,7 @@ const searchPlugin = function () {
const done = () => {
localStorage.setItem('docsify.search.expires', Date.now() + CONFIG.maxAge)
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS))
console.log(INDEXS)
}

paths.forEach(path => {
Expand Down

0 comments on commit 345f7e4

Please sign in to comment.