Only RegEx if there is something to RegEx
This commit is contained in:
parent
db2560d7fc
commit
5c9cc49363
1 changed files with 1 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
module Diaspora
|
module Diaspora
|
||||||
module Camo
|
module Camo
|
||||||
def self.from_markdown(markdown_text)
|
def self.from_markdown(markdown_text)
|
||||||
|
return unless markdown_text
|
||||||
markdown_text.gsub(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/m) do |link|
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue