Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Metadata not in correct format - in v3.7.2 only #470
(IMO) ever since this commit,
We are getting the following runtime error:
We use yaml headers on each page, and they are in the format:
We haven't changed how the metadata headers are formatted. Has anything changed in how the yaml header / metadata should be formatted?
To avoid this error, we have had to set the nanoc version in the gemfile to 3.7.1 and uninstall version 3.7.2 of the nanoc gem from our local machines.
Thanks in advance.
Yes, #463 changed the way content is separated from metadata. However, we didn't notice any regression when running the tests.
Could you please copy paste the exact content of the offending file? Or ideally upload the offending file somewhere?
It fails on any file that has \r\n line endings instead of \n line endings. I narrowed down the problem to this regex that is new in 3.7.2:
One way to fix it would be:
Note that the last parameter to split limits the number of pieces so there is no need to join them later, which could potentially mess up a file that has '---' somewhere in the middle.