mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 22:26:10 +08:00
FIX: be more tactical with replacing markdown chars
* instead of using encodeURIComponent in imageNameFromFileName, we just replace the bad characters that we wanted to get rid of in the first place where we introduced encodeURIComponent. as per review
This commit is contained in:
parent
b89e634dd4
commit
dbfe9540fa
@ -14,7 +14,9 @@ function imageNameFromFileName(fileName) {
|
||||
name = I18n.t("upload_selector.default_image_alt_text");
|
||||
}
|
||||
|
||||
return encodeURIComponent(name).replace(/%20/g, " ");
|
||||
return name.replace(/\[|\]|\|/g, "");
|
||||
|
||||
// return encodeURIComponent(name).replace(/%20/g, " ");
|
||||
}
|
||||
|
||||
export function validateUploadedFiles(files, opts) {
|
||||
|
@ -198,7 +198,7 @@ QUnit.test("getUploadMarkdown", assert => {
|
||||
);
|
||||
assert.equal(
|
||||
testUploadMarkdown("[foo|bar].png"),
|
||||
""
|
||||
""
|
||||
);
|
||||
assert.equal(
|
||||
testUploadMarkdown("file name with space.png"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user