comparison 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
comparison
equal deleted inserted replaced
477:737a0c261a77 478:d280b27fed17
1 // ---------------------------------------------------------------------------- 1 // ----------------------------------------------------------------------------
2 // markItUp! Universal MarkUp Engine, JQuery plugin 2 // markItUp! Universal MarkUp Engine, JQuery plugin
3 // v 1.1.11 3 // v 1.1.x
4 // Dual licensed under the MIT and GPL licenses. 4 // Dual licensed under the MIT and GPL licenses.
5 // ---------------------------------------------------------------------------- 5 // ----------------------------------------------------------------------------
6 // Copyright (C) 2007-2011 Jay Salvat 6 // Copyright (C) 2007-2011 Jay Salvat
7 // http://markitup.jaysalvat.com/ 7 // http://markitup.jaysalvat.com/
8 // ---------------------------------------------------------------------------- 8 // ----------------------------------------------------------------------------
248 block = openWith + placeHolder + closeWith; 248 block = openWith + placeHolder + closeWith;
249 } else { 249 } else {
250 string = string || selection; 250 string = string || selection;
251 251
252 var lines = selection.split(/\r?\n/), blocks = []; 252 var lines = selection.split(/\r?\n/), blocks = [];
253
253 for (var l=0; l < lines.length; l++) { 254 for (var l=0; l < lines.length; l++) {
254 line = lines[l]; 255 line = lines[l];
255 if ($.trim(line) == '') { 256 var trailingSpaces;
256 continue; 257 if (trailingSpaces = line.match(/ *$/)) {
257 } 258 blocks.push(openWith + line.replace(/ *$/g, '') + closeWith + trailingSpaces);
258 if (line.match(/ +$/)) {
259 blocks.push(openWith + line.replace(/ $/, '') + closeWith + ' ');
260 } else { 259 } else {
261 blocks.push(openWith + line + closeWith); 260 blocks.push(openWith + line + closeWith);
262 } 261 }
263 } 262 }
264 263