From 54a1180140971d0ba0c5d44f95cf8e7618781881 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 1 Sep 2016 11:55:40 +0530 Subject: [PATCH] FIX: properly insert images in markdown inline format --- app/jobs/regular/pull_hotlinked_images.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb index c3f4623f197..cedf9efa5b8 100644 --- a/app/jobs/regular/pull_hotlinked_images.rb +++ b/app/jobs/regular/pull_hotlinked_images.rb @@ -63,6 +63,8 @@ module Jobs raw.gsub!(/\[!\[([^\]]*)\]\(#{escaped_src}\)\]/) { "[#{$1}]" } # Markdown inline - ![alt](http://...) raw.gsub!(/!\[([^\]]*)\]\(#{escaped_src}\)/) { "![#{$1}](#{url})" } + # Markdown inline - ![](http://... "image title") + raw.gsub!(/!\[\]\(#{escaped_src} "([^\]]*)"\)/) { "![](#{url})" } # Markdown reference - [x]: http:// raw.gsub!(/\[([^\]]+)\]:\s?#{escaped_src}/) { "[#{$1}]: #{url}" } # Direct link