FIX: File size text should not be part of link.

FIX: File size text should not be part of link.

diff --git a/app/assets/javascripts/discourse/lib/utilities.js.es6 b/app/assets/javascripts/discourse/lib/utilities.js.es6
index 7c1e9a3..be80d4c 100644
--- a/app/assets/javascripts/discourse/lib/utilities.js.es6
+++ b/app/assets/javascripts/discourse/lib/utilities.js.es6
@@ -444,9 +444,9 @@ export function getUploadMarkdown(upload) {
   ) {
     return uploadLocation(upload.url);
   } else {
-    return `[${upload.original_filename} (${I18n.toHumanSize(
-      upload.filesize
-    )})|attachment](${upload.short_url})`;
+    return `[${upload.original_filename}|attachment](${
+      upload.short_url
+    }) (${I18n.toHumanSize(upload.filesize)})`;
   }
 }
 
diff --git a/test/javascripts/lib/utilities-test.js.es6 b/test/javascripts/lib/utilities-test.js.es6
index f01b0c7..a11264c 100644
--- a/test/javascripts/lib/utilities-test.js.es6
+++ b/test/javascripts/lib/utilities-test.js.es6
@@ -194,7 +194,7 @@ QUnit.test("getUploadMarkdown", assert => {
 
   assert.equal(
     testUploadMarkdown("important.txt", { short_url }),
-    `[important.txt (42 Bytes)|attachment](${short_url})`
+    `[important.txt|attachment](${short_url}) (42 Bytes)`
   );
 });

GitHub sha: e5cace91

1 Like