Skip to content
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

Unable to read frontmatter for some JSON values #3682

Closed
aquilax opened this issue Jul 7, 2017 · 5 comments
Closed

Unable to read frontmatter for some JSON values #3682

aquilax opened this issue Jul 7, 2017 · 5 comments
Assignees
Milestone

Comments

@aquilax
Copy link

aquilax commented Jul 7, 2017

$ hugo version
Hugo Static Site Generator v0.24.1 linux/amd64 BuildDate: 2017-06-24T10:27:00+02:00

The front matter in question uses JSON and has escaped quote in a value:

{
    "desc": " \"test"
}

This results in the following error:

Started building sites ...
ERROR 2017/07/07 16:53:45 unable to read frontmatter at filepos 27: EOF
Error: Error building site: Errors reading pages: Error: unable to read frontmatter at filepos 27: EOF for test.md

while jq parses JSON the file correctly:

$ jq . content/test.md 
{
  "desc": " \"test"
}
@bep
Copy link
Member

bep commented Jul 7, 2017

This is fixed in Hugo 0.25.

@bep bep closed this as completed Jul 7, 2017
@aquilax
Copy link
Author

aquilax commented Jul 7, 2017

@bep I get the same issue but with slashes now:

{
    "url": "http:\/\/example.com\/play\/url?id=1"
}
$ hugo serve
Started building sites ...
ERROR 2017/07/07 18:00:47 unable to read frontmatter at filepos 54: EOF
Error: Error building site: Errors reading pages: Error: unable to read frontmatter at filepos 54: EOF for
$ hugo version
Hugo Static Site Generator v0.25 linux/386 BuildDate: 2017-07-07T09:30:11+02:00

@bep bep reopened this Jul 7, 2017
@bep bep changed the title Unable to read frontmatter for some JSON values: Unable to read frontmatter for some JSON values Jul 8, 2017
@bep bep added the Bug label Jul 8, 2017
@bep bep self-assigned this Jul 8, 2017
@bep bep added this to the v0.25.1 milestone Jul 8, 2017
@bep bep closed this as completed in 84db6c7 Jul 8, 2017
@aquilax
Copy link
Author

aquilax commented Jul 8, 2017

@bep Will report here so I don't pollute the issues:

{
    "test": "\"New\r\nString\""
}
{
    "test": "RTS\/RPG"
}

fail with the same message:

ERROR 2017/07/08 17:50:55 unable to read frontmatter at filepos xx: EOF

Running with the latest master.

Hugo Static Site Generator v0.26-DEV linux/amd64 BuildDate: 2017-07-08T17:46:39+02:00

@bep
Copy link
Member

bep commented Jul 8, 2017

I should never have started touching this front matter handling. :=)

@bep bep reopened this Jul 8, 2017
@bep bep closed this as completed in 7f82b41 Jul 8, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants