mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
add YAML front matter when exporting
This commit is contained in:
@@ -386,6 +386,17 @@ function removeStorageAndNoteReferences (input, noteKey) {
|
||||
return input.replace(new RegExp(mdurl.encode(path.sep), 'g'), path.sep).replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), DESTINATION_FOLDER)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description replace all :storage references with given destination folder.
|
||||
* @param input Input in which the references should be deleted
|
||||
* @param noteKey Key of the current note
|
||||
* @param destinationFolder Destination folder of the attachements
|
||||
* @returns {String} Input without the references
|
||||
*/
|
||||
function replaceStorageReferences (input, noteKey, destinationFolder) {
|
||||
return input.replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + '(' + escapeStringRegexp(path.sep) + noteKey + ')?', 'g'), destinationFolder || DESTINATION_FOLDER)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Deletes the attachment folder specified by the given storageKey and noteKey
|
||||
* @param storageKey Key of the storage of the note to be deleted
|
||||
@@ -542,6 +553,7 @@ module.exports = {
|
||||
getAttachmentsInMarkdownContent,
|
||||
getAbsolutePathsOfAttachmentsInContent,
|
||||
removeStorageAndNoteReferences,
|
||||
replaceStorageReferences,
|
||||
deleteAttachmentFolder,
|
||||
deleteAttachmentsNotPresentInNote,
|
||||
moveAttachments,
|
||||
|
||||
Reference in New Issue
Block a user