File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,14 @@ function doSearch(value) {
150
150
return ;
151
151
}
152
152
153
- const matchs = search ( value ) ;
153
+ let matchs = search ( value ) ;
154
+
155
+ if (
156
+ options . resultPreHanlder &&
157
+ typeof options . resultPreHanlder === 'function'
158
+ ) {
159
+ matchs = options . resultPreHanlder ( matchs ) ;
160
+ }
154
161
155
162
let html = '' ;
156
163
matchs . forEach ( post => {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const CONFIG = {
11
11
hideOtherSidebarContent : false ,
12
12
namespace : undefined ,
13
13
pathNamespaces : undefined ,
14
+ resultPreHanlder : undefined ,
14
15
} ;
15
16
16
17
const install = function ( hook , vm ) {
@@ -29,6 +30,7 @@ const install = function (hook, vm) {
29
30
opts . hideOtherSidebarContent || CONFIG . hideOtherSidebarContent ;
30
31
CONFIG . namespace = opts . namespace || CONFIG . namespace ;
31
32
CONFIG . pathNamespaces = opts . pathNamespaces || CONFIG . pathNamespaces ;
33
+ CONFIG . resultPreHanlder = opts . resultPreHanlder || CONFIG . resultPreHanlder ;
32
34
}
33
35
34
36
const isAuto = CONFIG . paths === 'auto' ;
You can’t perform that action at this time.
0 commit comments