File tree 2 files changed +7
-28
lines changed
2 files changed +7
-28
lines changed Original file line number Diff line number Diff line change @@ -211,15 +211,14 @@ export function search(query) {
211
211
}
212
212
213
213
const matchContent =
214
- handlePostContent &&
215
214
'...' +
216
- handlePostContent
217
- . substring ( start , end )
218
- . replace (
219
- regEx ,
220
- word => `<em class="search-keyword">${ word } </em>`
221
- ) +
222
- '...' ;
215
+ handlePostContent
216
+ . substring ( start , end )
217
+ . replace (
218
+ regEx ,
219
+ word => `<em class="search-keyword">${ word } </em>`
220
+ ) +
221
+ '...' ;
223
222
224
223
resultStr += matchContent ;
225
224
}
Original file line number Diff line number Diff line change @@ -176,24 +176,4 @@ test.describe('Search Plugin Tests', () => {
176
176
await searchFieldElm . fill ( 'hello' ) ;
177
177
await expect ( resultsHeadingElm ) . toHaveText ( 'Changelog Title' ) ;
178
178
} ) ;
179
- test ( 'search when there is no body' , async ( { page } ) => {
180
- const docsifyInitConfig = {
181
- markdown : {
182
- homepage : `
183
- # EmptyContent
184
- ---
185
- ---
186
- ` ,
187
- } ,
188
- scriptURLs : [ '/lib/plugins/search.min.js' ] ,
189
- } ;
190
-
191
- const searchFieldElm = page . locator ( 'input[type=search]' ) ;
192
- const resultsHeadingElm = page . locator ( '.results-panel h2' ) ;
193
-
194
- await docsifyInit ( docsifyInitConfig ) ;
195
-
196
- await searchFieldElm . fill ( 'empty' ) ;
197
- await expect ( resultsHeadingElm ) . toHaveText ( 'EmptyContent' ) ;
198
- } ) ;
199
179
} ) ;
You can’t perform that action at this time.
0 commit comments