FIX: Replace %20 with space in markdown file name for uploads (#8405)

Meta: https://meta.discourse.org/t/image-name-has-20-in-file-name/134136

We were ending up with [file%20name](url) in the markdown preview, which looked weird and
affected the alt text. this is because we were calling encodeURIComponent, which has been left in place because this is a valid thing to do for some cases. (e.g. f674b9e)
This commit is contained in:
Martin Brennan
2019-11-25 13:54:55 +10:00
committed by GitHub
parent afb5533581
commit b89e634dd4
2 changed files with 5 additions and 1 deletions

View File

@ -200,6 +200,10 @@ QUnit.test("getUploadMarkdown", assert => {
testUploadMarkdown("[foo|bar].png"),
"![%5Bfoo%7Cbar%5D|100x200](/uploads/123/abcdef.ext)"
);
assert.equal(
testUploadMarkdown("file name with space.png"),
"![file name with space|100x200](/uploads/123/abcdef.ext)"
);
const short_url = "uploads://asdaasd.ext";