File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,14 @@ function doSearch(value) {
150150 return ;
151151 }
152152
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+ }
154161
155162 let html = '' ;
156163 matchs . forEach ( post => {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const CONFIG = {
1111 hideOtherSidebarContent : false ,
1212 namespace : undefined ,
1313 pathNamespaces : undefined ,
14+ resultPreHanlder : undefined ,
1415} ;
1516
1617const install = function ( hook , vm ) {
@@ -29,6 +30,7 @@ const install = function (hook, vm) {
2930 opts . hideOtherSidebarContent || CONFIG . hideOtherSidebarContent ;
3031 CONFIG . namespace = opts . namespace || CONFIG . namespace ;
3132 CONFIG . pathNamespaces = opts . pathNamespaces || CONFIG . pathNamespaces ;
33+ CONFIG . resultPreHanlder = opts . resultPreHanlder || CONFIG . resultPreHanlder ;
3234 }
3335
3436 const isAuto = CONFIG . paths === 'auto' ;
You can’t perform that action at this time.
0 commit comments