Commit cbc4adc Kang Cheng
committed
1 parent 1897bb6 commit cbc4adc Copy full SHA for cbc4adc
File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 1
1
let INDEXS = { }
2
- let helper
3
2
4
3
function escapeHtml ( string ) {
5
4
const entityMap = {
@@ -17,7 +16,7 @@ function escapeHtml(string) {
17
16
function getAllPaths ( router ) {
18
17
const paths = [ ]
19
18
20
- helper . dom . findAll ( 'a :not([data-nosearch])') . forEach ( node => {
19
+ document . querySelectorAll ( '.sidebar-nav a:not(.section-link) :not([data-nosearch])') . forEach ( node => {
21
20
const href = node . href
22
21
const originHref = node . getAttribute ( 'href' )
23
22
const path = router . parse ( href ) . path
@@ -149,8 +148,6 @@ export function search(query) {
149
148
}
150
149
151
150
export function init ( config , vm ) {
152
- helper = Docsify
153
-
154
151
const isAuto = config . paths === 'auto'
155
152
const isExpired = localStorage . getItem ( 'docsify.search.expires' ) < Date . now ( )
156
153
@@ -171,7 +168,7 @@ export function init(config, vm) {
171
168
return count ++
172
169
}
173
170
174
- helper
171
+ Docsify
175
172
. get ( vm . router . getFile ( path ) , false , vm . config . requestHeaders )
176
173
. then ( result => {
177
174
INDEXS [ path ] = genIndex ( path , result , vm . router , config . depth )
You can’t perform that action at this time.
0 commit comments