Re-apply 15ca8db58d
which got lost in a merge
This commit is contained in:
parent
25820a9100
commit
e68c74b4f7
|
@ -30,11 +30,7 @@ module Middleman
|
||||||
# @param [Hash] params
|
# @param [Hash] params
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def image_tag(path, params={})
|
def image_tag(path, params={})
|
||||||
params[:supported_extensions] ||= %w(.png .jpg .jpeg .bmp .gif)
|
if !params.has_key?(:width) && !params.has_key?(:height) && !path.include?("://")
|
||||||
|
|
||||||
if !params.has_key?(:width) && !params.has_key?(:height) && !path.include?("://") &&
|
|
||||||
params[:supported_extensions].include?(File.extname(path).downcase)
|
|
||||||
|
|
||||||
params[:alt] ||= ""
|
params[:alt] ||= ""
|
||||||
|
|
||||||
real_path = path
|
real_path = path
|
||||||
|
@ -54,8 +50,6 @@ module Middleman
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
params.delete(:supported_extensions)
|
|
||||||
|
|
||||||
super(path, params)
|
super(path, params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue