diff --git a/static/js/html2notecase.js b/static/js/html2notecase.js
index e2de65012..0241175cd 100644
--- a/static/js/html2notecase.js
+++ b/static/js/html2notecase.js
@@ -1,7 +1,11 @@
function html2notecase(contents, note) {
+ //console.log("'" + contents + "'");
+
// 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(/
<\/p>/g, '\n');
+ contents = contents.replace(/
<\/p>/g, '\n');
contents = contents.replace(/
/g, '\n');
contents = contents.replace(/
/g, '\n');
contents = contents.replace(/<\/p>/g, '\n');
@@ -144,7 +148,9 @@ function html2notecase(contents, note) {
}
}
- //console.log(contents);
+ contents = contents.trim();
+
+ //console.log('"' + contents + '"');
note.detail.note_text = contents;
}
\ No newline at end of file
diff --git a/static/js/notecase2html.js b/static/js/notecase2html.js
index 54e56c721..c4d66f9f7 100644
--- a/static/js/notecase2html.js
+++ b/static/js/notecase2html.js
@@ -43,7 +43,11 @@ function notecase2html(note) {
}
}
- noteText = noteText.replace(/(?:\r\n|\r|\n)/g, '
');
+ noteText = noteText.replace(/(?:\r\n|\r)/g, '\n');
+
+ noteText = noteText.replace(/(.+)\n/g, '
$1
'); + + noteText = noteText.replace(/\n/g, '