Permalink
Browse files

Fix display of plain text containing multiple carriage returns before…

… line feed.

Closes gh-2560
  • Loading branch information...
1 parent f32a646 commit ea37b42dc802d44f1a5a2ab9648b67fb52c069c0 @takluyver committed Nov 8, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 IPython/frontend/html/notebook/static/js/utils.js
@@ -195,7 +195,8 @@ IPython.utils = (function (IPython) {
tmp = txt;
do {
txt = tmp;
- tmp = txt.replace(/^.*\r(?!\n)/gm, '');
+ tmp = txt.replace(/\r+\n/gm, '\n'); // \r followed by \n --> newline
+ tmp = tmp.replace(/^.*\r+/gm, ''); // Other \r --> clear line
} while (tmp.length < txt.length);
return txt;
}

0 comments on commit ea37b42

Please sign in to comment.