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

Exclude period from sanitization #5450

Closed
wants to merge 2 commits into from
Closed

Exclude period from sanitization #5450

wants to merge 2 commits into from

Conversation

levlaz
Copy link

@levlaz levlaz commented Oct 6, 2016

Excluding period from sanitize_filename allows users to have periods in
the name of a data file.

fix #5429

Excluding period from sanitize_filename allows users to have periods in
the name of a data file.
This addresses `empty range in char class`
@levlaz
Copy link
Author

levlaz commented Oct 6, 2016

Does anyone know what this failure means?

Failure:

TestSite#test_: configuring sites should have an array for plugins by default.  [/home/travis/build/jekyll/jekyll/test/test_site.rb:7]

Minitest::Assertion: --- expected

+++ actual

@@ -1 +1 @@

-["/home/travis/build/jekyll/jekyll/_plugins"]

+["/home/travis/build/jekyll/jekyll/test/source/_plugins"]

I am not getting this locally (OS X, Ruby 2.3.1), does not look like it has anything to do with these changes either.

@ashmaroli
Copy link
Member

ashmaroli commented Oct 6, 2016

@levlaz, that error is a known bug actually. The error occurs in random test-suites for random rvm versions.. it'll go away when our maintainers will restart that test for you..

@pathawks
Copy link
Member

pathawks commented Oct 6, 2016

it'll go away when our maintainers will restart that test for you.

@ashmaroli
Copy link
Member

@levlaz there's a similar fix in an older PR #5433

@parkr
Copy link
Member

parkr commented Oct 6, 2016

Thanks! We appreciate the pull request. Unfortunately, we won't be able to accept this patch.

We sanitize the period out on purpose: the . is what Liquid uses to traverse hashes. Consider:

{{ site.data.my_file.some_key_in_that_file }}

Each is delineated by a .. Liquid would error if we allowed periods in filenames, because it wouldn't know what is what:

{{ site.data.my.file.some_key_in_that_file }}

This would translate to:

{{ site[data][my][file][some_key_in_that_file] }}

#5433 correctly strips the period from directory names as is required for proper data access.

@parkr parkr closed this Oct 6, 2016
@jekyll jekyll locked and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jekyll incorrectly processes _data subdirs with a period in the name
5 participants