mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: Support upload:// urls in img tags (#16277)
Previously, our `upload://` protocol urls were only supported in markdown image tags. This meant that our PullHotlinkedImages job was forced to convert `<img` tags to markdown. Depending on the exact syntax, this can actually cause the image to break. This commit adds support for `upload://` inside regular HTML `<img` tags. In a future commit, we'll be able to use this to make our PullHotlinkedImages job much more robust. Context at https://meta.discourse.org/t/152801
This commit is contained in:
@ -1877,6 +1877,12 @@ HTML
|
||||
|
||||
})
|
||||
|
||||
Inline img <img src="#{upload.short_url}">
|
||||
|
||||
<div>
|
||||
Block img <img src="#{upload.short_url}">
|
||||
</div>
|
||||
|
||||
[some attachment](#{upload.short_url})
|
||||
|
||||
[some attachment|attachment](#{upload.short_url})
|
||||
@ -1901,6 +1907,10 @@ HTML
|
||||
</li>
|
||||
</ul>
|
||||
<p><img src="#{cdn_url}" alt="upload" data-base62-sha1="#{upload.base62_sha1}"></p>
|
||||
<p>Inline img <img src="#{cdn_url}" data-base62-sha1="#{upload.base62_sha1}"></p>
|
||||
<div>
|
||||
Block img <img src="#{cdn_url}" data-base62-sha1="#{upload.base62_sha1}">
|
||||
</div>
|
||||
<p><a href="#{upload.short_path}">some attachment</a></p>
|
||||
<p><a class="attachment" href="#{upload.short_path}">some attachment</a></p>
|
||||
<p><a href="#{upload.short_path}">some attachment|random</a></p>
|
||||
|
Reference in New Issue
Block a user