From dd9d5a7207b746342d07176d8969dc4f2c380bf2 Mon Sep 17 00:00:00 2001 From: Zak Kemble Date: Thu, 3 Mar 2022 13:49:05 +0000 Subject: [PATCH] fix: use `jsonify` to generate valid json (#521) --- assets/js/data/search.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/data/search.json b/assets/js/data/search.json index 0aaf170..5192c9f 100644 --- a/assets/js/data/search.json +++ b/assets/js/data/search.json @@ -6,13 +6,13 @@ swcache: true [ {% for post in site.posts %} { - "title": "{{ post.title | escape }}", - "url": "{{ post.url | relative_url }}", - "categories": "{{ post.categories | join: ', '}}", - "tags": "{{ post.tags | join: ', ' }}", + "title": {{ post.title | jsonify }}, + "url": {{ post.url | relative_url | jsonify }}, + "categories": {{ post.categories | join: ', ' | jsonify }}, + "tags": {{ post.tags | join: ', ' | jsonify }}, "date": "{{ post.date }}", {% include no-linenos.html content=post.content %} - "snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}" + "snippet": {{ content | strip_html | strip_newlines | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} ]