mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: uploading a file with a non-ASCII character wasn't removing the placeholder
This commit is contained in:
parent
16a06233ca
commit
af7f00099f
1 changed files with 4 additions and 4 deletions
|
@ -342,9 +342,9 @@ const ComposerView = Ember.View.extend(Ember.Evented, {
|
|||
this.messageBus.subscribe("/uploads/composer", upload => {
|
||||
if (!cancelledByTheUser) {
|
||||
if (upload && upload.url) {
|
||||
const old = Discourse.Utilities.getUploadPlaceholder(upload.original_filename),
|
||||
const regex = new RegExp(`\\[${I18n.t("uploading")}.+?\\]\\(\\)`),
|
||||
markdown = Discourse.Utilities.getUploadMarkdown(upload);
|
||||
this.replaceMarkdown(old, markdown);
|
||||
this.replaceMarkdown(regex, markdown);
|
||||
} else {
|
||||
Discourse.Utilities.displayErrorForUpload(upload);
|
||||
}
|
||||
|
@ -527,9 +527,9 @@ const ComposerView = Ember.View.extend(Ember.Evented, {
|
|||
});
|
||||
},
|
||||
|
||||
replaceMarkdown(old, text) {
|
||||
replaceMarkdown(regex, text) {
|
||||
const reply = this.get("model.reply");
|
||||
this.set("model.reply", reply.replace(old, text));
|
||||
this.set("model.reply", reply.replace(regex, text));
|
||||
},
|
||||
|
||||
// Uses javascript to get the image sizes from the preview, if present
|
||||
|
|
Loading…
Reference in a new issue