mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Temporarily revert "FEATURE: Support [description|attachment](upload://<short-sha>)
in MD. (#7603)"
This reverts commit b1d3c678ca39cf7f09ac3eb257c7153d4863a2a9. We need to make sure post_upload records are correctly stored.
This commit is contained in:
@ -1260,11 +1260,9 @@ HTML
|
||||
|
||||
end
|
||||
|
||||
describe "upload decoding" do
|
||||
describe "image decoding" do
|
||||
|
||||
it "can decode upload:// for default setup" do
|
||||
set_cdn_url('https://cdn.com')
|
||||
|
||||
upload = Fabricate(:upload)
|
||||
|
||||
raw = <<~RAW
|
||||
@ -1276,12 +1274,6 @@ HTML
|
||||
- 
|
||||
|
||||
})
|
||||
|
||||
[some attachment](#{upload.short_url})
|
||||
|
||||
[some attachment|attachment](#{upload.short_url})
|
||||
|
||||
[some attachment|random](#{upload.short_url})
|
||||
RAW
|
||||
|
||||
cooked = <<~HTML
|
||||
@ -1298,9 +1290,6 @@ HTML
|
||||
</li>
|
||||
</ul>
|
||||
<p><img src="#{upload.url}" alt="upload"></p>
|
||||
<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>
|
||||
HTML
|
||||
|
||||
expect(PrettyText.cook(raw)).to eq(cooked.strip)
|
||||
@ -1308,15 +1297,10 @@ HTML
|
||||
|
||||
it "can place a blank image if we can not find the upload" do
|
||||
|
||||
raw = <<~MD
|
||||

|
||||
|
||||
[some attachment|attachment](upload://abcdefg.png)
|
||||
MD
|
||||
raw = ""
|
||||
|
||||
cooked = <<~HTML
|
||||
<p><img src="/images/transparent.png" alt="upload" data-orig-src="upload://abcABC.png"></p>
|
||||
<p><a href="/404" data-orig-href="upload://abcdefg.png">some attachment|attachment</a></p>
|
||||
<p><img src="/images/transparent.png" alt="upload" data-orig-src="upload://abcABC.png"></p>
|
||||
HTML
|
||||
|
||||
expect(PrettyText.cook(raw)).to eq(cooked.strip)
|
||||
|
Reference in New Issue
Block a user