mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Shorter code
This commit is contained in:
committed by
Junyoung Choi
parent
c474d972cb
commit
fba9afd6f5
@@ -465,14 +465,10 @@ function importAttachments (markDownContent, filepath, storageKey, noteKey) {
|
|||||||
const groupIndex = 2
|
const groupIndex = 2
|
||||||
|
|
||||||
while (attachPath) {
|
while (attachPath) {
|
||||||
attachmentPaths.push(attachPath[groupIndex])
|
let attachmentPath = attachPath[groupIndex]
|
||||||
|
attachmentPaths.push(attachmentPath)
|
||||||
if (path.isAbsolute(attachPath[groupIndex])) {
|
attachmentPath = path.isAbsolute(attachmentPath) ? attachmentPath : path.join(path.dirname(filepath), attachmentPath)
|
||||||
promiseArray.push(this.copyAttachment(attachPath[groupIndex], storageKey, noteKey))
|
promiseArray.push(this.copyAttachment(attachmentPath, storageKey, noteKey))
|
||||||
} else {
|
|
||||||
const fullPath = path.join(path.dirname(filepath), attachPath[groupIndex])
|
|
||||||
promiseArray.push(this.copyAttachment(fullPath, storageKey, noteKey))
|
|
||||||
}
|
|
||||||
attachPath = nameRegex.exec(markDownContent)
|
attachPath = nameRegex.exec(markDownContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user