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 Camo
|
||||
def self.from_markdown(markdown_text)
|
||||
return unless markdown_text
|
||||
markdown_text.gsub(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/m) do |link|
|
||||
link.gsub($4, self.image_url($4))
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue