mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Fixes #1827 -> include attachments in HTML exports of notes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import copyFile from 'browser/main/lib/dataApi/copyFile'
|
||||
import { findStorage } from 'browser/lib/findStorage'
|
||||
import filenamify from 'filenamify'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
@@ -29,21 +28,7 @@ function exportNote (storageKey, noteContent, targetPath, outputFormatter) {
|
||||
throw new Error('Storage path is not found')
|
||||
}
|
||||
|
||||
let exportedData = noteContent.replace(LOCAL_STORED_REGEX, (match, dstFilename, srcFilename) => {
|
||||
dstFilename = filenamify(dstFilename, {replacement: '_'})
|
||||
if (!path.extname(dstFilename)) {
|
||||
dstFilename += path.extname(srcFilename)
|
||||
}
|
||||
|
||||
const dstRelativePath = path.join(IMAGES_FOLDER_NAME, dstFilename)
|
||||
|
||||
exportTasks.push({
|
||||
src: path.join(IMAGES_FOLDER_NAME, srcFilename),
|
||||
dst: dstRelativePath
|
||||
})
|
||||
|
||||
return ``
|
||||
})
|
||||
let exportedData = noteContent
|
||||
|
||||
if (outputFormatter) {
|
||||
exportedData = outputFormatter(exportedData, exportTasks)
|
||||
|
||||
Reference in New Issue
Block a user