From 36e525952708272fe855d180ed16f7a2886386cd Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 23 Aug 2017 20:35:47 -0400 Subject: [PATCH] possible fix to "double new lines" --- static/js/html2notecase.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/html2notecase.js b/static/js/html2notecase.js index 786b2ac21..25f191705 100644 --- a/static/js/html2notecase.js +++ b/static/js/html2notecase.js @@ -1,4 +1,7 @@ function html2notecase(contents, note) { + // remove any possible extra newlines which might be inserted - all relevant new lines should be only in
and

+ contents = contents.replace(/(?:\r\n|\r|\n)/, ''); + contents = contents.replace(/
/g, '\n'); contents = contents.replace(/
/g, '\n'); contents = contents.replace(/<\/p>/g, '\n');