From 8b41c1ef314415dc2e5f1accd76c2d488d0d965a Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 7 Sep 2018 10:26:23 +0200 Subject: [PATCH] fix pasting HTML content into subnotes --- src/public/javascripts/services/tree.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.js index ae766b790..244d899e6 100644 --- a/src/public/javascripts/services/tree.js +++ b/src/public/javascripts/services/tree.js @@ -530,8 +530,8 @@ function parseSelectedHtml(selectedHtml) { if (dom.length > 0 && dom[0].tagName && dom[0].tagName.match(/h[1-6]/i)) { const title = $(dom[0]).text(); - const domWithoutTitle = dom.slice(1); - const content = domWithoutTitle.map(el => $(el).html()).join(""); + // remove the title from content (only first occurence) + const content = selectedHtml.replace(dom[0].outerHTML, ""); return [title, content]; }