Optimize Document::DATE_FILENAME_MATCHER to match valid filenames (#7292)

Merge pull request 7292
This commit is contained in:
Ashwin Maroli 2019-03-15 23:08:12 +05:30 committed by jekyllbot
parent 5bc0ddd6d2
commit cc7978f3bc
3 changed files with 8 additions and 2 deletions

View File

@ -12,7 +12,7 @@ module Jekyll
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m.freeze
DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$!.freeze
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$!.freeze
DATE_FILENAME_MATCHER = %r!^(?>.+/)*?(\d{2,4}-\d{1,2}-\d{1,2})-([^/]*)(\.[^.]+)$!.freeze
# Create a new Document.
#

View File

@ -0,0 +1,6 @@
---
title: What Am I?
---
I am not a post.
Am I a document then..?

View File

@ -95,7 +95,7 @@ class TestSite < JekyllUnitTest
context "creating sites" do
setup do
@site = Site.new(site_configuration)
@num_invalid_posts = 5
@num_invalid_posts = 6
end
teardown do