lib/onebox/helpers.rb in onebox-1.8.50 vs lib/onebox/helpers.rb in onebox-1.8.51
- old
+ new
@@ -171,10 +171,11 @@
def self.truncate(string, length = 50)
string.size > length ? string[0...(string.rindex(" ", length) || length)] + "..." : string
end
def self.title_attr(meta)
- (meta && !blank?(meta[:title])) ? "title='#{meta[:title]}'" : ""
+ title = meta[:title].gsub("'", "'").gsub('"', """)
+ (meta && !blank?(title)) ? "title='#{title}'" : ""
end
def self.normalize_url_for_output(url)
return "" unless url
url = url.dup