diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index f35cdb0e..ad5884ef 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -9,7 +9,7 @@ module Jekyll YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$! - DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$! + DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{4}-\d{2}-\d{2})-(.*)(\.[^.]+)$! # Create a new Document. # diff --git a/test/source/_methods/3940394-21-9393050-fifif1323-test.md b/test/source/_methods/3940394-21-9393050-fifif1323-test.md new file mode 100644 index 00000000..848d0204 --- /dev/null +++ b/test/source/_methods/3940394-21-9393050-fifif1323-test.md @@ -0,0 +1,5 @@ +--- +title: "this is a test!" +--- + +wheee diff --git a/test/test_document.rb b/test/test_document.rb index e4d7abbf..5b9156f3 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -492,4 +492,33 @@ class TestDocument < JekyllUnitTest assert_equal true, File.file?(@dest_file) end end + + context "a document in a collection with dash-separated numeric file name" do + setup do + @site = fixture_site({ + "collections" => { + "methods" => { + "output" => true + } + } + }) + @site.process + @document = @site.collections["methods"].docs.find do |doc| + doc.relative_path == "_methods/3940394-21-9393050-fifif1323-test.md" + end + @dest_file = dest_dir("methods/3940394-21-9393050-fifif1323-test.html") + end + + should "produce the right URL" do + assert_equal "/methods/3940394-21-9393050-fifif1323-test.html", @document.url + end + + should "produce the right destination" do + assert_equal @dest_file, @document.destination(dest_dir) + end + + should "be output in the correct place" do + assert_equal true, File.file?(@dest_file) + end + end end