FIX: encode image filename so '[', ']' and '|' doesn't break the markdown

This commit is contained in:
Régis Hanol
2018-01-19 19:52:03 +01:00
parent 645c32758a
commit f674b9e86e
2 changed files with 4 additions and 3 deletions

View File

@ -291,13 +291,13 @@ function isGUID(value) {
function imageNameFromFileName(fileName) {
const split = fileName.split('.');
const name = split[split.length-2];
let name = split[split.length - 2];
if (exports.isAppleDevice() && isGUID(name)) {
return I18n.t('upload_selector.default_image_alt_text');
name = I18n.t('upload_selector.default_image_alt_text');
}
return name;
return encodeURIComponent(name);
}
export function allowsImages() {