added links to the import/export + fixing internal links inside note content

This commit is contained in:
azivner
2018-11-16 11:42:06 +01:00
parent 46c7901e1f
commit e0f9a7fc6a
4 changed files with 78 additions and 18 deletions

View File

@@ -1,10 +1,10 @@
const sax = require("sax");
const stream = require('stream');
const xml2js = require('xml2js');
const log = require("./log");
const utils = require("./utils");
const noteService = require("./notes");
const imageService = require("./image");
const log = require("../log");
const utils = require("../utils");
const noteService = require("../notes");
const imageService = require("../image");
// date format is e.g. 20181121T193703Z
function parseDate(text) {

View File

@@ -69,6 +69,7 @@ async function createNewNote(parentNoteId, noteData) {
noteData.mime = noteData.mime || parentNote.mime;
const note = await new Note({
noteId: noteData.noteId, // optionally can force specific noteId
title: noteData.title,
content: noteData.content,
isProtected: noteData.isProtected,
@@ -116,6 +117,7 @@ async function createNote(parentNoteId, title, content = "", extraOptions = {})
title: title,
content: extraOptions.json ? JSON.stringify(content, null, '\t') : content,
target: 'into',
noteId: extraOptions.noteId,
isProtected: !!extraOptions.isProtected,
type: extraOptions.type,
mime: extraOptions.mime,