1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Make image path relative

This commit is contained in:
asmsuechan
2017-07-26 13:02:44 +09:00
parent 0266770657
commit 044e6b7180
4 changed files with 18 additions and 5 deletions

View File

@@ -192,8 +192,8 @@ export default class CodeEditor extends React.Component {
const imagePath = e.dataTransfer.files[0].path
const filename = path.basename(imagePath)
copyImage(imagePath, this.props.storageKey).then((imagePathInTheStorage) => {
const imageMd = `![${filename}](${imagePathInTheStorage})`
copyImage(imagePath, this.props.storageKey).then((imagePath) => {
const imageMd = `![${filename}](${path.join('/:storage', imagePath)})`
this.insertImageMd(imageMd)
})
}