Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r20215: LJSV-1833: autosaved draft dropping extr...

Committer: vkurkin
LJSV-1833: autosaved draft dropping extra line breaks
U   trunk/htdocs/js/rte.js
Modified: trunk/htdocs/js/rte.js
===================================================================
--- trunk/htdocs/js/rte.js	2011-10-04 06:55:54 UTC (rev 20214)
+++ trunk/htdocs/js/rte.js	2011-10-04 07:03:50 UTC (rev 20215)
@@ -51,7 +51,7 @@
 	}
 
 	function normalizeValue(str) {
-		return str.replace(/<br\s?\/>\n?/g, '\n').replace(/\s+$/mg, '').trim();
+		return str.replace(/<br\s?\/>\n?/g, '\n').trim();
 	}
 
 	function updateDraftState() {
@@ -129,7 +129,7 @@
 						if (window.switchedRteOn) {
 							var data = CKEditor.getData();
 							if(!$('#event_format')[0].checked){
-								data = data.replace(/(\r|\n)/g, '<br />');
+								data = data.replace(/\r|\n/g, '<br />');
 							}
 							draftData.textArea.val(data);
 						}

Tags: b_vladi, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments