From 628128ff398888e5115dbcba36924bbea25c8906 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 25 Oct 2021 16:22:23 -0400 Subject: [PATCH] add italic and underline styles --- ansi_up.js | 24 +++++++++++++++-- ansi_up.ts | 29 ++++++++++++++++++--- dist/ansi_up.d.ts | 4 +++ dist/ansi_up.js.include | 24 +++++++++++++++-- dist/ansi_up.js.map | 2 +- test/ansi_up-test.js | 58 ++++++++++++++++++++++++++++++++++++----- 6 files changed, 126 insertions(+), 15 deletions(-) diff --git a/ansi_up.js b/ansi_up.js index fe186ee..448d26f 100644 --- a/ansi_up.js +++ b/ansi_up.js @@ -38,6 +38,8 @@ var AnsiUp = (function () { this.setup_palettes(); this._use_classes = false; this.bold = false; + this.italic = false; + this.underline = false; this.fg = this.bg = null; this._buffer = ''; this._url_whitelist = { 'http': 1, 'https': 1 }; @@ -266,7 +268,7 @@ var AnsiUp = (function () { return blocks.join(""); }; AnsiUp.prototype.with_state = function (pkt) { - return { bold: this.bold, fg: this.fg, bg: this.bg, text: pkt.text }; + return { bold: this.bold, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: pkt.text }; }; AnsiUp.prototype.process_ansi = function (pkt) { var sgr_cmds = pkt.text.split(';'); @@ -276,13 +278,27 @@ var AnsiUp = (function () { if (isNaN(num) || num === 0) { this.fg = this.bg = null; this.bold = false; + this.italic = false; + this.underline = false; } else if (num === 1) { this.bold = true; } + else if (num === 3) { + this.italic = true; + } + else if (num === 4) { + this.underline = true; + } else if (num === 22) { this.bold = false; } + else if (num === 23) { + this.italic = false; + } + else if (num === 24) { + this.underline = false; + } else if (num === 39) { this.fg = null; } @@ -335,7 +351,7 @@ var AnsiUp = (function () { if (txt.length === 0) return txt; txt = this.escape_txt_for_html(txt); - if (!fragment.bold && fragment.fg === null && fragment.bg === null) + if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null) return txt; var styles = []; var classes = []; @@ -343,6 +359,10 @@ var AnsiUp = (function () { var bg = fragment.bg; if (fragment.bold) styles.push('font-weight:bold'); + if (fragment.italic) + styles.push('font-style:italic'); + if (fragment.underline) + styles.push('text-decoration:underline'); if (!this._use_classes) { if (fg) styles.push("color:rgb(" + fg.rgb.join(',') + ")"); diff --git a/ansi_up.ts b/ansi_up.ts index 324b066..b70f435 100644 --- a/ansi_up.ts +++ b/ansi_up.ts @@ -23,6 +23,8 @@ interface TextWithAttr { fg:AU_Color; bg:AU_Color; bold:boolean; + italic: boolean; + underline: boolean; text:string; } @@ -64,7 +66,8 @@ class AnsiUp private fg:AU_Color; private bg:AU_Color; private bold:boolean; - + private italic: boolean; + private underline:boolean; private _use_classes:boolean; private _csi_regex:RegExp; @@ -83,6 +86,8 @@ class AnsiUp this._use_classes = false; this.bold = false; + this.italic = false; + this.underline = false; this.fg = this.bg = null; this._buffer = ''; @@ -538,7 +543,7 @@ class AnsiUp } private with_state(pkt:TextPacket):TextWithAttr { - return { bold: this.bold, fg: this.fg, bg: this.bg, text: pkt.text }; + return { bold: this.bold, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: pkt.text }; } private process_ansi(pkt:TextPacket) @@ -558,10 +563,20 @@ class AnsiUp if (isNaN(num) || num === 0) { this.fg = this.bg = null; this.bold = false; + this.italic = false; + this.underline = false; } else if (num === 1) { this.bold = true; + } else if (num === 3) { + this.italic = true; + } else if (num === 4) { + this.underline = true; } else if (num === 22) { this.bold = false; + } else if (num === 23) { + this.italic = false; + } else if (num === 24) { + this.underline = false; } else if (num === 39) { this.fg = null; } else if (num === 49) { @@ -624,7 +639,7 @@ class AnsiUp txt = this.escape_txt_for_html(txt); // If colors not set, default style is used - if (!fragment.bold && fragment.fg === null && fragment.bg === null) + if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null) return txt; let styles:string[] = []; @@ -635,7 +650,13 @@ class AnsiUp // Note on bold: https://stackoverflow.com/questions/6737005/what-are-some-advantages-to-using-span-style-font-weightbold-rather-than-b?rq=1 if (fragment.bold) - styles.push('font-weight:bold') + styles.push('font-weight:bold'); + + if (fragment.italic) + styles.push('font-style:italic'); + + if (fragment.underline) + styles.push('text-decoration:underline'); if (!this._use_classes) { // USE INLINE STYLES diff --git a/dist/ansi_up.d.ts b/dist/ansi_up.d.ts index 7642764..a00d80d 100644 --- a/dist/ansi_up.d.ts +++ b/dist/ansi_up.d.ts @@ -6,6 +6,8 @@ export interface TextWithAttr { fg: AU_Color; bg: AU_Color; bold: boolean; + italic: boolean; + underline: boolean; text: string; } declare enum PacketKind { @@ -29,6 +31,8 @@ export default class AnsiUp { private fg; private bg; private bold; + private italic; + private underline; private _use_classes; private _csi_regex; private _osc_st; diff --git a/dist/ansi_up.js.include b/dist/ansi_up.js.include index 1d26c10..199bf71 100644 --- a/dist/ansi_up.js.include +++ b/dist/ansi_up.js.include @@ -19,6 +19,8 @@ var AnsiUp = (function () { this.setup_palettes(); this._use_classes = false; this.bold = false; + this.italic = false; + this.underline = false; this.fg = this.bg = null; this._buffer = ''; this._url_whitelist = { 'http': 1, 'https': 1 }; @@ -247,7 +249,7 @@ var AnsiUp = (function () { return blocks.join(""); }; AnsiUp.prototype.with_state = function (pkt) { - return { bold: this.bold, fg: this.fg, bg: this.bg, text: pkt.text }; + return { bold: this.bold, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: pkt.text }; }; AnsiUp.prototype.process_ansi = function (pkt) { var sgr_cmds = pkt.text.split(';'); @@ -257,13 +259,27 @@ var AnsiUp = (function () { if (isNaN(num) || num === 0) { this.fg = this.bg = null; this.bold = false; + this.italic = false; + this.underline = false; } else if (num === 1) { this.bold = true; } + else if (num === 3) { + this.italic = true; + } + else if (num === 4) { + this.underline = true; + } else if (num === 22) { this.bold = false; } + else if (num === 23) { + this.italic = false; + } + else if (num === 24) { + this.underline = false; + } else if (num === 39) { this.fg = null; } @@ -316,7 +332,7 @@ var AnsiUp = (function () { if (txt.length === 0) return txt; txt = this.escape_txt_for_html(txt); - if (!fragment.bold && fragment.fg === null && fragment.bg === null) + if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null) return txt; var styles = []; var classes = []; @@ -324,6 +340,10 @@ var AnsiUp = (function () { var bg = fragment.bg; if (fragment.bold) styles.push('font-weight:bold'); + if (fragment.italic) + styles.push('font-style:italic'); + if (fragment.underline) + styles.push('text-decoration:underline'); if (!this._use_classes) { if (fg) styles.push("color:rgb(" + fg.rgb.join(',') + ")"); diff --git a/dist/ansi_up.js.map b/dist/ansi_up.js.map index 7e802b8..940cb59 100644 --- a/dist/ansi_up.js.map +++ b/dist/ansi_up.js.map @@ -1 +1 @@ -{"version":3,"file":"ansi_up.js","sourceRoot":"","sources":["../ansi_up.ts"],"names":[],"mappings":"AAMA,YAAY,CAAC;;;;;AAwBb,IAAK,UAQJ;AARD,WAAK,UAAU;IACX,yCAAG,CAAA;IACH,2CAAI,CAAA;IACJ,uDAAU,CAAA;IACV,yCAAG,CAAA;IACH,iDAAO,CAAA;IACP,yCAAG,CAAA;IACH,+CAAM,CAAA;AACV,CAAC,EARI,UAAU,KAAV,UAAU,QAQd;AAYD;IA4BI;QA1BA,YAAO,GAAG,OAAO,CAAC;QA6Bd,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElB,IAAI,CAAC,cAAc,GAAG,EAAE,MAAM,EAAC,CAAC,EAAE,OAAO,EAAC,CAAC,EAAE,CAAC;IAClD,CAAC;IAED,sBAAI,+BAAW;aAKf;YAEI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aARD,UAAgB,GAAW;YAEvB,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;QAC5B,CAAC;;;OAAA;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AAM,GAAG,eAAY,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,WAAK,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,SAAM,CAAC;QACxG,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,aAAC;AAAD,CAAC,AAjpBD,IAipBC;AAOD,SAAS,GAAG,CAAC,OAAO;IAAE,eAAQ;SAAR,UAAQ,EAAR,qBAAQ,EAAR,IAAQ;QAAR,8BAAQ;;IAE1B,IAAI,SAAS,GAAU,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAGtC,IAAI,KAAK,GAAG,gCAAgC,CAAC;IAC7C,IAAI,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAID,SAAS,IAAI,CAAC,OAAO;IAAE,eAAQ;SAAR,UAAQ,EAAR,qBAAQ,EAAR,IAAQ;QAAR,8BAAQ;;IAE3B,IAAI,SAAS,GAAU,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAGtC,IAAI,KAAK,GAAG,gCAAgC,CAAC;IAC7C,IAAI,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file diff --git a/test/ansi_up-test.js b/test/ansi_up-test.js index 2f5eb01..2db13aa 100644 --- a/test/ansi_up-test.js +++ b/test/ansi_up-test.js @@ -275,6 +275,30 @@ describe('ansi_up', function () { l.should.eql(expected); }); + it('should transform an italic attr;foreground to html', function () { + var attr = 3; + var fg = 32; + var start = "\033[" + attr + ";" + fg + "m " + attr + ";" + fg + " \033[0m"; + + var expected = " " + attr + ";" + fg + " "; + + var au = new AnsiUp(); + var l = au.ansi_to_html(start); + l.should.eql(expected); + }); + + it('should transform an underline attr;foreground to html', function () { + var attr = 4; + var fg = 32; + var start = "\033[" + attr + ";" + fg + "m " + attr + ";" + fg + " \033[0m"; + + var expected = " " + attr + ";" + fg + " "; + + var au = new AnsiUp(); + var l = au.ansi_to_html(start); + l.should.eql(expected); + }); + it('should transform a bright-foreground to html', function () { var fg = 92; var start = "\033[" + fg + "m " + fg + " \033[0m"; @@ -533,6 +557,34 @@ describe('ansi_up', function () { l.should.eql(expected); }); + it('should transform an italic attr;background;bright-foreground to html', function () { + var attr = 3; + var fg = 33; + var bg = 102; + var start = "\033[" + attr + ";" + bg + ";" + fg + "m " + attr + ";" + bg + ";" + fg + " \033[0m"; + + var expected = ' " + attr + ";" + bg + ";" + fg + " "; + + var au = new AnsiUp(); + au.use_classes = true; + var l = au.ansi_to_html(start); + l.should.eql(expected); + }); + + it('should transform an underline attr;background;bright-foreground to html', function () { + var attr = 4; + var fg = 33; + var bg = 102; + var start = "\033[" + attr + ";" + bg + ";" + fg + "m " + attr + ";" + bg + ";" + fg + " \033[0m"; + + var expected = ' " + attr + ";" + bg + ";" + fg + " "; + + var au = new AnsiUp(); + au.use_classes = true; + var l = au.ansi_to_html(start); + l.should.eql(expected); + }); + it('should transform a complex multi-line sequence to html', function () { var attr = 1; var fg = 32; @@ -663,12 +715,6 @@ describe('ansi_up', function () { l.should.containEql('baz'); l.should.containEql('1;31m'); }); - it('(italic)', function () { - var start = "foo\033[3mbar\033[0mbaz"; - var au = new AnsiUp(); - var l = au.ansi_to_html(start); - l.should.eql('foobarbaz'); - }); it('(cursor-up)', function () { var start = "foo\033[1Abar"; var au = new AnsiUp();