module HTML
class Pipeline
# HTML Filter that converts image's url into
tag.
# For example, it will convert
# http://example.com/test.jpg
# into
#
.
class ImageFilter < TextFilter
def call
@text.gsub(/(https|http)?:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
%(
)
end
end
end
end
end