From c97e901a738a1a5aa5b6ecc02bdfa461a91d5ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=A1=BA=E5=BC=BA?= Date: Tue, 24 Mar 2020 20:12:29 +0800 Subject: [PATCH] repair code bug (#4497) --- frontend/src/shared-file-view-markdown.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/shared-file-view-markdown.js b/frontend/src/shared-file-view-markdown.js index 3e56e25b67..470c5f7ee1 100644 --- a/frontend/src/shared-file-view-markdown.js +++ b/frontend/src/shared-file-view-markdown.js @@ -50,9 +50,10 @@ class FileContent extends React.Component { return; } // get image path - let index = imageUrl.indexOf('/file'); - let index2 = imageUrl.indexOf('?'); - const imagePath = imageUrl.substring(index + 5, index2); + let imagePath = imageUrl.substring(serviceURL.length); + let index = imagePath.indexOf('/file'); + let index2 = imagePath.indexOf('?'); + imagePath = imagePath.substring(index + 5, index2); // change image url innerNode.data.src = serviceURL + '/view-image-via-share-link/?token=' + sharedToken + '&path=' + imagePath; }