1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

repair code bug

This commit is contained in:
shanshuirenjia
2022-01-05 16:36:40 +08:00
parent 7ab606698c
commit 712d4fbb90

View File

@@ -734,9 +734,8 @@ class MarkdownEditor extends React.Component {
const fileName = Utils.getFileName(filePath); const fileName = Utils.getFileName(filePath);
const suffix = fileName.slice(fileName.indexOf('.') + 1); const suffix = fileName.slice(fileName.indexOf('.') + 1);
if (IMAGE_SUFFIXES.includes(suffix)) { if (IMAGE_SUFFIXES.includes(suffix)) {
seafileAPI.getFileDownloadLink(repoID, filePath).then((res) => { let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath) + '?raw=1';
window.richMarkdownEditor.addLink(fileName, res.data, true); window.richMarkdownEditor.addLink(fileName, innerURL, true);
});
return; return;
} }
let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath); let innerURL = serviceUrl + '/lib/' + repoID + '/file' + Utils.encodePath(filePath);