Merge pull request #1382 from torsneyt/fix_md_ext
Markdown extension matching matches only exact matches
This commit is contained in:
		
						commit
						ae218dd0db
					
				|  | @ -26,7 +26,7 @@ module Jekyll | |||
|       end | ||||
| 
 | ||||
|       def matches(ext) | ||||
|         rgx = '(' + @config['markdown_ext'].gsub(',','|') +')' | ||||
|         rgx = '^\.(' + @config['markdown_ext'].gsub(',','|') +')$' | ||||
|         ext =~ Regexp.new(rgx, Regexp::IGNORECASE) | ||||
|       end | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase | |||
|     end | ||||
| 
 | ||||
|     should "ensure post count is as expected" do | ||||
|       assert_equal 35, @site.posts.size | ||||
|       assert_equal 36, @site.posts.size | ||||
|     end | ||||
| 
 | ||||
|     should "insert site.posts into the index" do | ||||
|  |  | |||
|  | @ -562,6 +562,13 @@ class TestPost < Test::Unit::TestCase | |||
|       assert conv.kind_of? Jekyll::Converters::Markdown | ||||
|     end | ||||
| 
 | ||||
|     should "process .mkdn under text if it is not in the markdown config" do | ||||
|       @site.config['markdown_ext'] = 'markdown,mkd,md,text' | ||||
|       post = setup_post '2013-08-01-mkdn-extension.mkdn' | ||||
|       conv = post.converter | ||||
|       assert conv.kind_of? Jekyll::Converters::Identity | ||||
|     end | ||||
| 
 | ||||
|     should "process .text as textile under alternate configuration" do | ||||
|       @site.config['textile_ext'] = 'textile,text' | ||||
|       post = setup_post '2011-04-12-text-extension.text' | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue