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

Escape regex characters in paths to match #8138

Merged
merged 1 commit into from Apr 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/test_convertible.rb
Expand Up @@ -32,7 +32,7 @@ class TestConvertible < JekyllUnitTest
assert_equal({}, ret)
end
assert_match(%r!YAML Exception!, out)
assert_match(%r!#{File.join(@base, name)}!, out)
assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out)
end

should "raise for broken front matter with `strict_front_matter` set" do
Expand All @@ -57,7 +57,7 @@ class TestConvertible < JekyllUnitTest
assert_equal({}, ret)
end
assert_match(%r!invalid byte sequence in UTF-8!, out)
assert_match(%r!#{File.join(@base, name)}!, out)
assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out)
end

should "parse the front matter but show an error if permalink is empty" do
Expand Down