Skip to content

Commit

Permalink
Escape regex characters in paths to match (#8138)
Browse files Browse the repository at this point in the history
Merge pull request 8138
  • Loading branch information
dleidert committed Apr 27, 2020
1 parent c8c3891 commit 47e3644
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 47e3644

Please sign in to comment.