Skip to content

Commit

Permalink
fix line prefix detection when converting to blockquote
Browse files Browse the repository at this point in the history
  • Loading branch information
balpha committed Oct 7, 2011
1 parent 58de54e commit b99fe24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Markdown.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1485,10 +1485,11 @@

commandProto.wrap = function (chunk, len) {
this.unwrap(chunk);
var regex = new re("(.{1," + len + "})( +|$\\n?)", "gm");
var regex = new re("(.{1," + len + "})( +|$\\n?)", "gm"),
that = this;

chunk.selection = chunk.selection.replace(regex, function (line, marked) {
if (new re("^" + this.prefixes, "").test(line)) {
if (new re("^" + that.prefixes, "").test(line)) {
return line;
}
return marked + "\n";
Expand Down

0 comments on commit b99fe24

Please sign in to comment.