refactor(core): and cover

This commit is contained in:
qingwei.li 2017-02-18 17:02:16 +08:00 committed by cinwell.li
commit 27e7e749af
6 changed files with 69 additions and 8 deletions

View file

@ -5,7 +5,7 @@ import { genTree } from './gen-tree'
import { slugify, clearSlugCache } from './slugify'
import { emojify } from './emojify'
import { toURL } from '../route/hash'
import { isFn, merge, cached } from '../util/core'
import { isFn, merge, cached, noop } from '../util/core'
let markdownCompiler = marked
let contentBase = ''
@ -115,4 +115,10 @@ export function subSidebar (el, level) {
* Compile cover page
*/
export function cover (text) {
const cacheToc = toc.slice()
const html = markdown(text)
toc = cacheToc.slice()
return html
}