Bugfix: actually check file extensions
Chris Wanstrath chris@ozmm.org
Mon, 02 Nov 2009 17:35:39 -0800
2 files changed,
2 insertions(+),
1 deletions(-)
M
lib/github/markup.rb
→
lib/github/markup.rb
@@ -46,7 +46,7 @@ end
def renderer(filename) @@markups.each do |key, value| - if Regexp.compile("(#{key})$") =~ filename + if Regexp.compile("\\.(#{key})$") =~ filename return value end end
M
test/markup_test.rb
→
test/markup_test.rb
@@ -24,5 +24,6 @@
def test_knows_what_it_can_and_cannot_render assert_equal false, GitHub::Markup.can_render?('README.html') assert_equal true, GitHub::Markup.can_render?('README.markdown') + assert_equal false, GitHub::Markup.can_render?('README.cmd') end end