New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JSON front matter parsing with unterminated quote #3661

Closed
axi opened this Issue Jun 29, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@axi

axi commented Jun 29, 2017

We found that \" in a json string causes hugo error.
It appears with 3183b9a.
If we put another \" in the string, the parser doesn't break.

Should'nt \" char considers as a regular char ?

Here is an example valid json which throws an error:
{ "title": "spf13-vim 3.0 release and new website", "description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim. \" it will break there", "tags": [ ".vimrc", "plugins", "spf13-vim", "VIm" ], "date": "2012-04-06", "categories": [ "Development", "VIM" ], "slug": "-spf13-vim-3-0-release-and-new-website-" }

Here is an example valid json which doesn't throw an error:
{ "title": "spf13-vim 3.0 release and new website", "description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim. \" it will NOT break there\"", "tags": [ ".vimrc", "plugins", "spf13-vim", "VIm" ], "date": "2012-04-06", "categories": [ "Development", "VIM" ], "slug": "-spf13-vim-3-0-release-and-new-website-" }

@bep bep changed the title from Parsing valid json gives "unable to read frontmatter at filepos X" to Fix JSON front matter parsing with unterminated quote Jun 29, 2017

@bep bep added the Bug label Jun 29, 2017

@bep bep closed this in e10e51a Jul 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment