mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 01:26:18 -05:00
Merge pull request #4431 from techAPJ/pull-images
FIX: properly insert images in markdown inline format
This commit is contained in:
commit
6c6a7755ae
1 changed files with 2 additions and 0 deletions
|
@ -63,6 +63,8 @@ module Jobs
|
|||
raw.gsub!(/\[!\[([^\]]*)\]\(#{escaped_src}\)\]/) { "[<img src='#{url}' alt='#{$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
|
||||
|
|
Loading…
Reference in a new issue