ansilove.js

A script to display ANSi and artscene related file formats on web pages
Log | Files | Refs | README | LICENSE

commit 10c5708a8cf10d8c1c3ae0624a4074dacd2884b6
parent 170907f4c119fc02a06b84bdebfb957f755e1146
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Tue, 15 Oct 2013 21:42:34 +0100

When encountering a lone LF, treat as a normal line-feed.

Diffstat:
Mansilove.js | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -926,6 +926,9 @@ var AnsiLove = (function () { } } else { switch (code) { + case 10: + newLine(); + break; case 13: if (file.peek() === 0x0A) { file.read(1); @@ -1307,6 +1310,11 @@ var AnsiLove = (function () { } } else { switch (code) { + case 10: + if (newLine()) { + return i + 1; + } + break; case 13: if (file.peek() === 0x0A) { file.read(1);