diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js
index 4adbbc18f..d760c0f5c 100644
--- a/www/common/diffMarked.js
+++ b/www/common/diffMarked.js
@@ -19,6 +19,8 @@ define([
return Marked(md);
};
+ var mediaMap = {};
+
// Tasks list
var checkedTaskItemPtn = /^\s*\[x\]\s*/;
var uncheckedTaskItemPtn = /^\s*\[ \]\s*/;
@@ -40,7 +42,14 @@ define([
if (href.slice(0,6) === '/file/') {
var parsed = Cryptpad.parsePadUrl(href);
var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel);
- var mt = '';
+ var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName;
+ var mt = '';
+ if (mediaMap[src]) {
+ mediaMap[src].forEach(function (n) {
+ mt += n.outerHTML;
+ });
+ }
+ mt += '';
return mt;
}
var out = '