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

Pasting an image should insert a relative attachment file link -> fixes #1953

This commit is contained in:
ehhc
2018-05-22 09:08:37 +02:00
committed by Sosuke Suzuki
parent 4bc0cccb24
commit ddd1522e19

View File

@@ -177,7 +177,8 @@ function handlePastImageEvent (codeEditor, storageKey, noteKey, dataTransferItem
base64data += base64data.replace('+', ' ') base64data += base64data.replace('+', ' ')
const binaryData = new Buffer(base64data, 'base64').toString('binary') const binaryData = new Buffer(base64data, 'base64').toString('binary')
fs.writeFileSync(imagePath, binaryData, 'binary') fs.writeFileSync(imagePath, binaryData, 'binary')
const imageMd = generateAttachmentMarkdown(imageName, imagePath, true) const imageReferencePath = path.join(STORAGE_FOLDER_PLACEHOLDER, noteKey, imageName)
const imageMd = generateAttachmentMarkdown(imageName, imageReferencePath, true)
codeEditor.insertAttachmentMd(imageMd) codeEditor.insertAttachmentMd(imageMd)
} }
reader.readAsDataURL(blob) reader.readAsDataURL(blob)