Sha256: 4302a81d0bd156627e4ecb91f73d4c39aab000da01d263f3dda1a2f1d9ed6f38
Contents?: true
Size: 459 Bytes
Versions: 30
Compression:
Stored size: 459 Bytes
Contents
module Onebox module Engine class ImageOnebox include Engine matches_regexp /^(https?:)?\/\/.+\.(png|jpg|jpeg|gif|bmp|tif|tiff)(\?.*)?$/i def to_html # Fix Dropbox image links if /^https:\/\/www.dropbox.com\/s\//.match @url @url.gsub!("https://www.dropbox.com","https://dl.dropboxusercontent.com") end "<a href='#{@url}' target='_blank'><img src='#{@url}'></a>" end end end end
Version data entries
30 entries across 30 versions & 1 rubygems