add linebreaks when uploading a file

This commit is contained in:
Régis Hanol 2016-05-20 11:35:47 +02:00
parent 0634834009
commit c4f93846f9
2 changed files with 2 additions and 2 deletions

View file

@ -269,7 +269,7 @@ Discourse.Utilities = {
// is Audio/Video
return Discourse.Utilities.uploadLocation(upload.url);
} else {
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')';
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')\n';
}
},

View file

@ -92,7 +92,7 @@ var getUploadMarkdown = function(filename) {
test("getUploadMarkdown", function() {
ok(getUploadMarkdown("lolcat.gif") === '<img src="/uploads/123/abcdef.ext" width="100" height="200">');
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/uploads/123/abcdef.ext">important.txt</a> (42 Bytes)');
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/uploads/123/abcdef.ext">important.txt</a> (42 Bytes)\n');
});
test("isAnImage", function() {