From b4e6245f7b165883e155ba8600059eb22181ee29 Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 26 Nov 2017 21:00:42 -0500 Subject: [PATCH] fix --- public/javascripts/note_editor.js | 2 +- public/javascripts/note_tree.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/javascripts/note_editor.js b/public/javascripts/note_editor.js index 6716544c9..53593f90e 100644 --- a/public/javascripts/note_editor.js +++ b/public/javascripts/note_editor.js @@ -66,7 +66,7 @@ const noteEditor = (function() { note.detail.note_text = contents; if (!note.detail.is_protected) { - const linkRegexp = /]+?href="[^"]*app#([A-Za-z0-9]{22})"[^>]*?>[^<]+?<\/a>/g; + const linkRegexp = /]+?href="[^"]*app#([A-Za-z0-9/]+)"[^>]*?>[^<]+?<\/a>/g; let match; while (match = linkRegexp.exec(contents)) { diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.js index d90229e07..92a797169 100644 --- a/public/javascripts/note_tree.js +++ b/public/javascripts/note_tree.js @@ -180,6 +180,11 @@ const noteTree = (function() { if (childNoteId !== null) { const parents = childToParents[childNoteId]; + if (!parents) { + console.error("No parents found for " + childNoteId); + return; + } + if (parentNoteId === null || !parents.includes(parentNoteId)) { console.log("Did not find parent " + parentNoteId + " for child " + childNoteId);