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

dos file format along with a space after +++ in frontmatter causes parsing to fail #6536

Open
bridgetkromhout opened this issue Sep 6, 2018 · 7 comments
Labels

Comments

@bridgetkromhout
Copy link
Collaborator

One of the problems I found in #5338 was that if the first +++ line of frontmatter in speaker and program files ends in a space like "+++ ", the files don't parse. Can we check for that in the build?

@mattstratton
Copy link
Member

I just tried to reproduce this, and failed. I took the program.md from 2018-chicago and added a space after the first +++ and hugo built it fine.

@bridgetkromhout
Copy link
Collaborator Author

I looked at this some more, and I can reproduce it locally with this combo:

  • a space after the initial +++
  • dos style file (converted in vi with :set ff=dos)

Testing to see if I can reproduce on netlify...

@bridgetkromhout
Copy link
Collaborator Author

bridgetkromhout commented Sep 7, 2018

Okay, you can see this here:

Note that Ken is missing: https://testing-dos-line-endings-bug--devopsdays-theme.netlify.com/events/2018-chicago/speakers

Note that Ken isn't a link: https://testing-dos-line-endings-bug--devopsdays-theme.netlify.com/events/2018-chicago/program

https://testing-dos-line-endings-bug--devopsdays-theme.netlify.com/events/2018-chicago/program/ken-mugrage

https://testing-dos-line-endings-bug--devopsdays-theme.netlify.com/events/2018-chicago/speakers/ken-mugrage

It's difficult to see what's going on unless you pull the branch I'm using in https://github.com/devopsdays/devopsdays-theme/pull/653/files down and then you can see this:
screen shot 2018-09-07 at 6 46 26 pm

Speakers for devopsdays Chicago 2018
Program for devopsdays Chicago 2018
+++ Talk_date = “” Talk_start_time = “” Talk_end_time = “” Title = “26 Feature Branches and other tales from the wild” Type = “talk” Speakers = [“ken-mugrage”] +++ In the 9 years I’ve been working with customers on continuous delivery systems I’ve seen some, ummm, great learning opportunities. This talk will go over some of the more interesting things I’ve seen during this time and might even give you a light hearted hint at ways to avoid some of them.
+++ Title = “Ken Mugrage” Twitter = “kmugrage” image = “ken-mugrage.jpg” type = “speaker” linktitle = “ken-mugrage” +++ Ken Mugrage has more than 25 years of experience in the IT industry, spending the last 9 at ThoughtWorks. During his entire career, Ken has focused on using technology to increase business effectiveness, as opposed to using the ‘latest cool thing’. Ken has been focused on Continuous Delivery and DevOps for most of the past decade, working with organizations all over the world, ranging from startups to Fortune 50 companies.
GitHub
this is only a test

This change is 

@bridgetkromhout bridgetkromhout changed the title space after +++ in frontmatter causes parsing to fail dos file format along with a space after +++ in frontmatter causes parsing to fail Sep 7, 2018
@bridgetkromhout
Copy link
Collaborator Author

bridgetkromhout commented Sep 7, 2018

Possibly relevant: https://discourse.gohugo.io/t/frontmatter-delimiter-must-be-followed-by-cr-lf-or-lf/5328/6

Hugo Discussion
I have the same error, but can not find the location of the problem. The error I get is: “Error: Error building site: frontmatter delimiter must be followed by CR+LF or LF but those can’t be found at filepos 302” Maybe a stupid question, but what is filepos 302? (file position? error position in a file? 302th file?) UPDATE: The error doesn’t show a file name (e.g. page-name.html). I’m using .html pages. I converted 3 other websites from PHP to HTML with Hugo in the same way, but without any ...

@bridgetkromhout
Copy link
Collaborator Author

Interested in what you think, @mattstratton - I would be inclined to document this and maybe (if we can?) fail the build on dos-style files?

@mattstratton
Copy link
Member

I like both ideas. Let's start with the documentation; I'm not sure how to check for the CR/LF stuff but I'm sure it's possible.

@bridgetkromhout
Copy link
Collaborator Author

Here's a simple check:

$ file unixfilename
unixfilename: ASCII text

$ file dosfilename
dosfilename: ASCII text, with CRLF line terminators

@mattstratton mattstratton transferred this issue from devopsdays/devopsdays-theme Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants