make sure image onebox is case insensitive
This commit is contained in:
parent
b7d3b52e4f
commit
3909f93a7e
2 changed files with 2 additions and 2 deletions
lib
|
@ -3,7 +3,7 @@ require_dependency 'oneboxer/base_onebox'
|
||||||
module Oneboxer
|
module Oneboxer
|
||||||
class ImageOnebox < BaseOnebox
|
class ImageOnebox < BaseOnebox
|
||||||
|
|
||||||
matcher /^https?:\/\/.*\.(jpg|png|gif|jpeg)$/
|
matcher /^(https?:)?\/\/.+\.(png|jpg|jpeg|gif|bmp|tif|tiff)$/i
|
||||||
|
|
||||||
def onebox
|
def onebox
|
||||||
Oneboxer::BaseOnebox.image_html(@url, nil, @url)
|
Oneboxer::BaseOnebox.image_html(@url, nil, @url)
|
||||||
|
|
|
@ -163,7 +163,7 @@ module PrettyText
|
||||||
def self.apply_cdn(html, url)
|
def self.apply_cdn(html, url)
|
||||||
return html unless url
|
return html unless url
|
||||||
|
|
||||||
image = /\.(jpg|jpeg|gif|png|tiff|tif|bmp)$/
|
image = /\.(png|jpg|jpeg|gif|bmp|tif|tiff)$/i
|
||||||
relative = /^\/[^\/]/
|
relative = /^\/[^\/]/
|
||||||
|
|
||||||
doc = Nokogiri::HTML.fragment(html)
|
doc = Nokogiri::HTML.fragment(html)
|
||||||
|
|
Reference in a new issue