diff options
author | Vitaly Takmazov | 2020-03-10 20:03:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-03-10 20:05:34 +0300 |
commit | c28afe791bd1be6ba2999d688f4ea2b00925ad37 (patch) | |
tree | 5f6e3e7707a3311a15f89bd0cd1adbd048207ac5 /src | |
parent | ee1ef7c01aa317fe484b1da5e40d108f0ec2e5ef (diff) |
Dirty fix for dropbox urls
Diffstat (limited to 'src')
-rw-r--r-- | src/main/assets/embed.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/assets/embed.js b/src/main/assets/embed.js index 079d07db..1fb7f25b 100644 --- a/src/main/assets/embed.js +++ b/src/main/assets/embed.js @@ -152,7 +152,9 @@ function getEmbeddableLinkTypes() { ctsDefault: false, re: /\.(jpe?g|png|svg)(:[a-zA-Z]+)?(?:\?[\w&;\?=]*)?$/i, makeNode: function(aNode, reResult, div) { - div.innerHTML = `<a href="${aNode.href}"><img src="${aNode.href}"></a>`; + // dirty fix for dropbox urls + let url = aNode.href.endsWith('dl=0') ? aNode.href.replace('dl=0', 'raw=1') : aNode.href; + div.innerHTML = `<a href="${url}"><img src="${url}"></a>`; return div; } }, |