-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Closed
Labels
bugSomething isn't workingSomething isn't workingreleasedIncluded or resolved in the releaseIncluded or resolved in the release
Description
Checklist
- I have read and accepted the contributing guidelines.
How did you create the site?
Generated from chirpy-starter
Describe the bug
When using Simple-Jekyll-Search, the browser console shows the following error:
SyntaxError: Bad escaped character in JSON at position 1473
As a result, the search feature does not work.
According to my speculation, this issue was introduced in commit 0eb7efa, which removed the jsonify
filter from the Liquid template generating search.json
:
"content": {{ _content | jsonify }}
Steps To Reproduce
-
Include a blog post where the content field contains a Windows file path, e.g.,:
... set environment path to C:\Program Files\...
-
Load the page, execute in
console
:fetch('/assets/js/data/search.json').then(r => r.json()).then(console.log).catch(console.error);
Expected Behavior
- The search.json file should load successfully without throwing a SyntaxError.
- All content, including Windows file paths (e.g., C:\Program Files...), should be correctly escaped and parsable as valid JSON.
- Simple-Jekyll-Search should initialize properly and return relevant search results based on user input.
Environment
Anything else?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingreleasedIncluded or resolved in the releaseIncluded or resolved in the release