mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: keep whitespaces when replacing direct link to external images with local images
This commit is contained in:
parent
482a65821b
commit
40b099f1a6
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue