fix(search): incorrect anchor link, fixed #90
This commit is contained in:
parent
855c450a97
commit
b8a3d8f380
5 changed files with 9 additions and 7 deletions
|
|
@ -2,12 +2,13 @@ import * as util from './util'
|
|||
import * as dom from './util/dom'
|
||||
import * as render from './render/compiler'
|
||||
import * as route from './route/hash'
|
||||
import { slugify } from './render/slugify'
|
||||
import { get } from './fetch/ajax'
|
||||
import marked from 'marked'
|
||||
import prism from 'prismjs'
|
||||
|
||||
export default function () {
|
||||
window.Docsify = { util, dom, render, route, get }
|
||||
window.Docsify = { util, dom, render, route, get, slugify }
|
||||
window.marked = marked
|
||||
window.Prism = prism
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import marked from 'marked'
|
|||
import Prism from 'prismjs'
|
||||
import { helper as helperTpl, tree as treeTpl } from './tpl'
|
||||
import { genTree } from './gen-tree'
|
||||
import { slugify, clearSlugCache } from './slugify'
|
||||
import { slugify } from './slugify'
|
||||
import { emojify } from './emojify'
|
||||
import { toURL, parse } from '../route/hash'
|
||||
import { getBasePath, isAbsolutePath, getPath } from '../route/util'
|
||||
|
|
@ -25,7 +25,7 @@ export const markdown = cached(text => {
|
|||
|
||||
html = markdownCompiler(text)
|
||||
html = emojify(html)
|
||||
clearSlugCache()
|
||||
slugify.clear()
|
||||
|
||||
return html
|
||||
})
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ export function slugify (str) {
|
|||
return slug
|
||||
}
|
||||
|
||||
export function clearSlugCache () {
|
||||
slugify.clear = function () {
|
||||
cache = {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue