mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 00:51:03 +08:00
FIX: keep whitespaces when replacing direct link to external images with local images
This commit is contained in:
parent
482a65821b
commit
40b099f1a6
|
@ -63,7 +63,7 @@ module Jobs
|
|||
# Markdown reference - [x]: http://
|
||||
raw.gsub!(/\[([^\]]+)\]:\s?#{escaped_src}/) { "[#{$1}]: #{url}" }
|
||||
# Direct link
|
||||
raw.gsub!(/^#{escaped_src}\s?$/, "<img src='#{url}'>")
|
||||
raw.gsub!(/^#{escaped_src}(\s?)$/) { "<img src='#{url}'>#{$1}" }
|
||||
end
|
||||
rescue => e
|
||||
Rails.logger.info("Failed to pull hotlinked image: #{src} post:#{post_id}\n" + e.message + "\n" + e.backtrace.join("\n"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user