consistently use root/ prefix for note paths

This commit is contained in:
azivner
2018-10-06 21:32:07 +02:00
parent 257cced182
commit 62de7f28eb
4 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import noteDetailText from './note_detail_text.js';
import treeUtils from './tree_utils.js';
function getNotePathFromLink(url) {
const notePathMatch = /#root([A-Za-z0-9/]*)$/.exec(url);
const notePathMatch = /#(root[A-Za-z0-9/]*)$/.exec(url);
if (notePathMatch === null) {
return null;
@@ -14,7 +14,7 @@ function getNotePathFromLink(url) {
}
function getNotePathFromLabel(label) {
const notePathMatch = / \(([#A-Za-z0-9/]+)\)/.exec(label);
const notePathMatch = / \(([A-Za-z0-9/]+)\)/.exec(label);
if (notePathMatch !== null) {
return notePathMatch[1];
+1 -1
View File
@@ -86,7 +86,7 @@ async function expandToNote(notePath, expandOpts) {
const node = getNodesByNoteId(childNoteId).find(node => node.data.parentNoteId === parentNoteId);
if (!node) {
console.log(`Can't find node for noteId=${childNoteId} with parentNoteId=${parentNoteId}`);
console.error(`Can't find node for noteId=${childNoteId} with parentNoteId=${parentNoteId}`);
}
if (childNoteId === noteId) {