-
-
Notifications
You must be signed in to change notification settings - Fork 10k
-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Jekyll fails to detect front matter on files with windows line endings #3304
Comments
Do you have a test file? We'd need to know what the status of the special characters is. |
For reference, here's the presently-used def has_yaml_header?(file)
!!(File.open(file, 'rb') { |f| f.read(5) } =~ /\A---\r?\n/)
end It's |
CR = Jekyll should normalize in and customize out: str1 = "hello\r"
str2 = "hello\r\n"
str1.encode(str1.encoding, :universal_newline => true) # => "hello\n"
str2.encode(str2.encoding, :universal_newline => true) # => "hello\n" Then on the way out do the same thing from an opt that Jekyll accepts, or if you detect Windows then default to |
I'm with @envygeeks that we should normalize, if possible (for our own sanity, and for our users' sanity). https://github.com/dweinberger/newclues/blob/master/newclues.html is an example file (with |
I'm good with this. I'll work on this next. |
I believe this has been fixed in Jekyll 3. THanks! |
Steps to reproduce (hint: line-ending-converter for Atom helps):
Expected:
Front matter is detected, file is read in
Actual:
File is treated as static HTML, front matter is converted raw.
Originally, I suspected this was my fault, introduced in #2211, but it appears it's
\r
safe. Perhaps it needs(\r|\n|\r\n)
?The text was updated successfully, but these errors were encountered: