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 · 4 comments

Comments

Projects
None yet
2 participants
@aquilax

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 7, 2017

Member

This is fixed in Hugo 0.25.

Member

bep commented Jul 7, 2017

This is fixed in Hugo 0.25.

@bep bep closed this Jul 7, 2017

@aquilax

This comment has been minimized.

Show comment
Hide comment
@aquilax

aquilax 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

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 from Unable to read frontmatter for some JSON values: to 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 in 84db6c7 Jul 8, 2017

@aquilax

This comment has been minimized.

Show comment
Hide comment
@aquilax

aquilax 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

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 8, 2017

Member

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

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 in 7f82b41 Jul 8, 2017

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