Markdown#matches should avoid regexp

This commit is contained in:
Parker Moore 2015-01-17 16:25:10 -08:00
parent f7271a6ef9
commit ef2d558874
1 changed files with 3 additions and 6 deletions

View File

@ -46,15 +46,12 @@ module Jekyll
].map(&:to_sym)
end
def extname_matches_regexp
@extname_matches_regexp ||= Regexp.new(
'^\.(' + @config['markdown_ext'].gsub(',','|') +')$',
Regexp::IGNORECASE
)
def extname_list
@extname_list ||= @config['markdown_ext'].split(',').map { |e| ".#{e.downcase}" }
end
def matches(ext)
ext =~ extname_matches_regexp
extname_list.include? ext.downcase
end
def output_ext(ext)