beautiful-jekyll
beautiful-jekyll copied to clipboard
[BUG] Search JSON doesn't escape back slashes and breaks search
https://github.com/daattali/beautiful-jekyll/blob/e5ababbfb57c0dbf5dae997c60271b4ccee6fed8/_includes/search.html#L14
This should be able to escape back slashes in the title. Since it doesn't, this creates invalid json and breaks the parsing:
Example:
{
"title": "Today I learned: Use %n rather than \n in String.format",
"category": "",
"url": "/blog2/2013/11/27/today-i-learned-use-n-rather-than-n-in-string-format/",
"date": "November 27, 2013"
},
Produces: SyntaxError: JSON.parse: bad control character in string literal
Thanks for the report. I'm surprised by this bug, because the title does get escaped. Most other characters seem to be correctly escaped, but it looks like a backslash needs to be escaped manually with another backslash (using \\
works fine according to my test). Do you agree this looks like a bug with the escape filter in jekyll/Liquid template, rather than a bug in the theme?
@monksy are you able to test to see whether this is a bug resulting from this theme or not?