Skip to content

Commit d97cc5d

Browse files
authored
Merge branch 'develop' into upgrade-caniuse-lit
2 parents d4056b6 + c98fda7 commit d97cc5d

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

Diff for: docs/deploy.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pa
77
There are three places to populate your docs for your GitHub repository:
88

99
- `docs/` folder
10-
- master branch
10+
- main branch
1111
- gh-pages branch
1212

13-
It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your GitHub Pages source in your repository's settings page.
13+
It is recommended that you save your files to the `./docs` subfolder of the `main` branch of your repository. Then select `main branch /docs folder` as your GitHub Pages source in your repository's settings page.
1414

1515
![GitHub Pages](_images/deploy-github-pages.png)
1616

17-
!> You can also save files in the root directory and select `master branch`.
17+
!> You can also save files in the root directory and select `main branch`.
1818
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch)
1919

2020
## GitLab Pages

Diff for: src/plugins/search/search.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,15 @@ export function search(query) {
211211
}
212212

213213
const matchContent =
214+
handlePostContent &&
214215
'...' +
215-
handlePostContent
216-
.substring(start, end)
217-
.replace(
218-
regEx,
219-
word => `<em class="search-keyword">${word}</em>`
220-
) +
221-
'...';
216+
handlePostContent
217+
.substring(start, end)
218+
.replace(
219+
regEx,
220+
word => `<em class="search-keyword">${word}</em>`
221+
) +
222+
'...';
222223

223224
resultStr += matchContent;
224225
}

Diff for: test/e2e/search.test.js

+20
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,24 @@ test.describe('Search Plugin Tests', () => {
176176
await searchFieldElm.fill('hello');
177177
await expect(resultsHeadingElm).toHaveText('Changelog Title');
178178
});
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+
});
179199
});

0 commit comments

Comments
 (0)