diff static/js/markitup/jquery.markitup.js @ 478:d280b27fed17

Updating to MarkitUp 1.1.12. Merging vendor branch changes into trunk.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Sep 2011 19:50:59 +0000
parents c78c6e007e61
children
line wrap: on
line diff
--- a/static/js/markitup/jquery.markitup.js	Fri Sep 09 22:16:40 2011 +0000
+++ b/static/js/markitup/jquery.markitup.js	Sun Sep 11 19:50:59 2011 +0000
@@ -1,6 +1,6 @@
 // ----------------------------------------------------------------------------
 // markItUp! Universal MarkUp Engine, JQuery plugin
-// v 1.1.11
+// v 1.1.x
 // Dual licensed under the MIT and GPL licenses.
 // ----------------------------------------------------------------------------
 // Copyright (C) 2007-2011 Jay Salvat
@@ -250,13 +250,12 @@
 					string = string || selection;
 
 					var lines = selection.split(/\r?\n/), blocks = [];
+					
 					for (var l=0; l < lines.length; l++) {
 						line = lines[l];
-						if ($.trim(line) == '') {
-							continue;
-						}
-						if (line.match(/ +$/)) {
-							blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' ');
+						var trailingSpaces;
+						if (trailingSpaces = line.match(/ *$/)) {
+							blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
 						} else {
 							blocks.push(openWith + line + closeWith);
 						}