mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 06:52:46 +08:00
Fix the build.
This commit is contained in:
parent
7a0d031bc4
commit
9daed05ad0
|
@ -105,7 +105,7 @@ module Jobs
|
||||||
InlineUploads.match_img(raw, external_src: true, &replace_raw)
|
InlineUploads.match_img(raw, external_src: true, &replace_raw)
|
||||||
|
|
||||||
# BBCode tag - [img]http://...[/img]
|
# BBCode tag - [img]http://...[/img]
|
||||||
InlineUploads.match_bbcode_img(raw, &replace_raw)
|
InlineUploads.match_bbcode_img(raw, external_src: true, &replace_raw)
|
||||||
|
|
||||||
# Markdown linked image - [![alt](http://...)](http://...)
|
# Markdown linked image - [![alt](http://...)](http://...)
|
||||||
# Markdown inline - ![alt](http://...)
|
# Markdown inline - ![alt](http://...)
|
||||||
|
|
|
@ -164,9 +164,9 @@ class InlineUploads
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.match_bbcode_img(markdown)
|
def self.match_bbcode_img(markdown, external_src: false)
|
||||||
markdown.scan(/(\[img\]\s?(.+)\s?\[\/img\])/) do |match|
|
markdown.scan(/(\[img\]\s?(.+)\s?\[\/img\])/) do |match|
|
||||||
if matched_uploads(match[1]).present? && block_given?
|
if (matched_uploads(match[1]).present? && block_given?) || external_src
|
||||||
yield(match[0], match[1], +"![](#{PLACEHOLDER})", $~.offset(0)[0])
|
yield(match[0], match[1], +"![](#{PLACEHOLDER})", $~.offset(0)[0])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user