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:
Penar Musaraj
2019-05-28 16:37:01 -04:00
parent f3c07e27d9
commit 7c9fb95c15
25 changed files with 282 additions and 574 deletions

View File

@ -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
- ![upload](#{upload.short_url})
![upload](#{upload.short_url.gsub(".png", "")})
[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
![upload](upload://abcABC.png)
[some attachment|attachment](upload://abcdefg.png)
MD
raw = "![upload](upload://abcABC.png)"
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)