Permalink
Browse files

Multiline is fixed.

  • Loading branch information...
1 parent 979af07 commit 328291e49a3c7e1fb76b3342f112734864836205 Jay Salvat committed Aug 16, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 markitup/jquery.markitup.js
@@ -249,9 +249,13 @@
} else {
string = string || selection;
- var lines = selection.split(/\r?\n/), blocks = [];
+ var lines = [string], blocks = [];
- for (var l=0; l < lines.length; l++) {
+ if (multiline === true) {
+ lines = string.split(/\r?\n/);
+ }
+
+ for (var l = 0; l < lines.length; l++) {
line = lines[l];
var trailingSpaces;
if (trailingSpaces = line.match(/ *$/)) {
@@ -307,6 +311,7 @@
lines[i] = "";
}
}
+
string = { block:lines.join('\n')};
start = caretPosition;
len = string.block.length + (($.browser.opera) ? n-1 : 0);

0 comments on commit 328291e

Please sign in to comment.