Markdown#matches should avoid regexp
This commit is contained in:
parent
f7271a6ef9
commit
ef2d558874
|
@ -46,15 +46,12 @@ module Jekyll
|
||||||
].map(&:to_sym)
|
].map(&:to_sym)
|
||||||
end
|
end
|
||||||
|
|
||||||
def extname_matches_regexp
|
def extname_list
|
||||||
@extname_matches_regexp ||= Regexp.new(
|
@extname_list ||= @config['markdown_ext'].split(',').map { |e| ".#{e.downcase}" }
|
||||||
'^\.(' + @config['markdown_ext'].gsub(',','|') +')$',
|
|
||||||
Regexp::IGNORECASE
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def matches(ext)
|
def matches(ext)
|
||||||
ext =~ extname_matches_regexp
|
extname_list.include? ext.downcase
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_ext(ext)
|
def output_ext(ext)
|
||||||
|
|
Loading…
Reference in New Issue