ansilove.js

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

commit dd8036934e7166d16e9dad8bac78100e1e7c1093
parent 93cdd0d64e5261b077f55df5d8835c4f44fe351b
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Wed, 28 Jun 2017 11:28:29 +0100

Deal more intelligently with .diz files

Diffstat:
Mansilove.js | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -1608,12 +1608,9 @@ var AnsiLove = (function () { // Choose which parser to use, based on the setting defined in <options.filetype>. switch (options.filetype) { case "txt": - case "nfo": - case "asc": // For plain-text files, use the ascii parser, and use the default, or user-defined font. data = asc(bytes, options); break; - case "diz": case "ion": // For diz files, use the ascii parser, and use the default, or user-defined font. Also, trim the extra columns. data = asc(bytes, options); @@ -1643,6 +1640,10 @@ var AnsiLove = (function () { // For XBin files, use the xb parser. Font is already set in the parser. data = xb(bytes, options); break; + case "diz": + data = ans(bytes, options); + data.imageData.trimColumns(); + break; default: // For unrecognised filetypes, use the ANSI parser. data = ans(bytes, options);