Fix Diaspora::Camo.from_markdown with frozen strings

This commit is contained in:
Benjamin Neff 2017-08-27 18:17:55 +02:00
parent f2ab09db17
commit 79c2db65d7
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -5,7 +5,7 @@ module Diaspora
module Camo module Camo
def self.from_markdown(markdown_text) def self.from_markdown(markdown_text)
return unless markdown_text return unless markdown_text
markdown_text.gsub!(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/m) do |link| markdown_text = markdown_text.gsub(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/m) do |link|
link.gsub($4, self.image_url($4)) link.gsub($4, self.image_url($4))
end end
markdown_text.gsub(/src=(['"])(.+?)\1/m) do |link| markdown_text.gsub(/src=(['"])(.+?)\1/m) do |link|