-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #779 from CloudCannon/feat/include-characters
Add configuration to include specific special characters while indexing
- Loading branch information
Showing
12 changed files
with
344 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
pagefind/integration_tests/characters/pagefind-matches-custom-characters.toolproof.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Character Tests > Pagefind matches custom characters | ||
steps: | ||
- ref: ./background.toolproof.yml | ||
- step: I have a "public/page_a/index.html" file with the content {html} | ||
html: >- | ||
<!DOCTYPE html><html lang="en"><head></head><body><h1>Talking about @money</h1></body></html> | ||
- step: I have a "public/page_b/index.html" file with the content {html} | ||
html: >- | ||
<!DOCTYPE html><html lang="en"><head></head><body><h1>Configure a^b^c^d</h1></body></html> | ||
- macro: I run Pagefind with '--include-characters "@^"' | ||
- step: stdout should contain "Running Pagefind" | ||
- step: The file "public/pagefind/pagefind.js" should not be empty | ||
- step: I serve the directory "public" | ||
- step: In my browser, I load "/" | ||
- step: In my browser, I evaluate {js} | ||
js: |- | ||
let pagefind = await import("/pagefind/pagefind.js"); | ||
let search = await pagefind.search("@"); | ||
let pages = await Promise.all(search.results.map(r => r.data())); | ||
toolproof.assert_eq(pages.length, 1); | ||
toolproof.assert_eq(pages[0].url, "/page_a/"); | ||
- step: In my browser, I evaluate {js} | ||
js: |- | ||
let pagefind = await import("/pagefind/pagefind.js"); | ||
let search = await pagefind.search("money"); | ||
let pages = await Promise.all(search.results.map(r => r.data())); | ||
toolproof.assert_eq(pages.length, 1); | ||
toolproof.assert_eq(pages[0].url, "/page_a/"); | ||
- step: In my browser, I evaluate {js} | ||
js: |- | ||
let pagefind = await import("/pagefind/pagefind.js"); | ||
let search = await pagefind.search("a^b^c^d"); | ||
let pages = await Promise.all(search.results.map(r => r.data())); | ||
toolproof.assert_eq(pages.length, 1); | ||
toolproof.assert_eq(pages[0].url, "/page_b/"); | ||
- step: In my browser, the console should be empty |
Oops, something went wrong.