CVE-2021-3377: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: The npm package ansi_up converts ANSI escape codes into HTML. In ansi_up v4, ANSI escape codes can be used to create HTML hyperlinks. Due to insufficient URL sanitization, this feature is affected by a cross-site scripting (XSS) vulnerability. This issue is fixed in v5.0.0.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
CVSS v3 base score: 6.1
Published: 2021-03-05T21:15Z
Repository: https://github.com/drudru/ansi_up
Language: JavaScript
Files changed: Readme.md, VERSION, ansi_up.js, ansi_up.ts, dist/ansi_up.d.ts, dist/ansi_up.js.include, dist/ansi_up.js.map, package.json, test/ansi_up-test.js
Commit date: 2021-01-29 01:08:39 -0600
Commit message: 5.0.0 - Security fix.

If you had a malformed URL when using the OSC URL sequence,
it would not be properly escaped.
Also, html escaping is now mandatory, so the API changed.
The 'escape_for_html' property was removed.

Diff: diff --git a/Readme.md b/Readme.md
index 8f368db..e48c625 100644
--- a/Readme.md
+++ b/Readme.md
@@ -117,18 +117,10 @@ This will instead set classes on the spans so the colors can be set via CSS.
 The class names used are of the format ````ansi-*-fg/bg```` and ````ansi-bright-*-fg/bg```` where * is the colour name, i.e black/red/green/yellow/blue/magenta/cyan/white.
 See the examples directory for a complete CSS theme for these classes.
 
 ## Properties
 
-#### escape_for_html
-(default: true)
-
-This does the minimum escaping of text to make it compliant with HTML.
-In particular, the '&','<', and '>' characters are escaped. It is
-** highly ** recommended that you do not set this to false. It will open
-the door security vulnerabilities.
-
 #### use_classes
 (default: false)
 
 This causes the SPAN tags to use classes to style the SPAN tags instead
 of specified RGB values.
@@ -138,16 +130,13 @@ of specified RGB values.
 
 This mapping is a whitelist of URI schemes that will be allowed to render HTML anchor tags.
 
 ## Buffering
 
-In general, the ansi_to_html *should* emit HTML when invoked with a non-empty string.
-The only exceptions are an incomplete ESC sequence or an incomplete escaped URL.
-For those cases, the library will buffer the escape or the sequence for the escaped URL.
-
-The library is also stateful. If a color is set in a prior invocation, then it will
-continue to emit that color in further invocations until the color/SGR attribute is changed.
+In general, the ansi_to_html *should* emit HTML output when invoked with a non-empty string.
+The only exceptions are an incomplete ESC sequence or an incomplete OSC URL sequence.
+For those cases, the library will buffer (not emit output), until it receives input that completes those sequences.
 
 ### Example of a Use Case
 
 I have used this library to 'tail' a file.
 
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..ceab6e1
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1
\ No newline at end of file
diff --git a/ansi_up.js b/ansi_up.js
index b207399..4482605 100644
--- a/ansi_up.js
+++ b/ansi_up.js
@@ -32,14 +32,13 @@ var PacketKind;
     PacketKind[PacketKind["SGR"] = 5] = "SGR";
     PacketKind[PacketKind["OSCURL"] = 6] = "OSCURL";
 })(PacketKind || (PacketKind = {}));
 var AnsiUp = (function () {
     function AnsiUp() {
-        this.VERSION = "4.0.3";
+        this.VERSION = "5.0.0";
         this.setup_palettes();
         this._use_classes = false;
-        this._escape_for_html = true;
         this.bold = false;
         this.fg = this.bg = null;
         this._buffer = '';
         this._url_whitelist = { 'http': 1, 'https': 1 };
     }
@@ -48,31 +47,21 @@ var AnsiUp = (function () {
             return this._use_classes;
         },
         set: function (arg) {
             this._use_classes = arg;
         },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
-        get: function () {
-            return this._escape_for_html;
-        },
-        set: function (arg) {
-            this._escape_for_html = arg;
-        },
-        enumerable: true,
+        enumerable: false,
         configurable: true
     });
     Object.defineProperty(AnsiUp.prototype, "url_whitelist", {
         get: function () {
             return this._url_whitelist;
         },
         set: function (arg) {
             this._url_whitelist = arg;
         },
-        enumerable: true,
+        enumerable: false,
         configurable: true
     });
     AnsiUp.prototype.setup_palettes = function () {
         var _this = this;
         this.ansi_colors =
@@ -118,17 +107,21 @@ var AnsiUp = (function () {
             var gry = { rgb: [grey_level, grey_level, grey_level], class_name: 'truecolor' };
             this.palette_256.push(gry);
         }
     };
     AnsiUp.prototype.escape_txt_for_html = function (txt) {
-        return txt.replace(/[&<>]/gm, function (str) {
+        return txt.replace(/[&<>"']/gm, function (str) {
             if (str === "&")
                 return "&amp;";
             if (str === "<")
                 return "&lt;";
             if (str === ">")
                 return "&gt;";
+            if (str === "\"")
+                return "&quot;";
+            if (str === "'")
+                return "&#x27;";
         });
     };
     AnsiUp.prototype.append_buffer = function (txt) {
         var str = this._buffer + txt;
         this._buffer = str;
@@ -339,12 +332,11 @@ var AnsiUp = (function () {
     };
     AnsiUp.prototype.transform_to_html = function (fragment) {
         var txt = fragment.text;
         if (txt.length === 0)
             return txt;
-        if (this._escape_for_html)
-            txt = this.escape_txt_for_html(txt);
+        txt = this.escape_txt_for_html(txt);
         if (!fragment.bold && fragment.fg === null && fragment.bg === null)
             return txt;
         var styles = [];
         var classes = [];
         var fg = fragment.fg;
diff --git a/ansi_up.ts b/ansi_up.ts
index 77740aa..016518f 100644
--- a/ansi_up.ts
+++ b/ansi_up.ts
@@ -48,11 +48,11 @@ interface TextPacket {
 // MAIN CLASS
 //
 
 class AnsiUp
 {
-    VERSION = "4.0.3";
+    VERSION = "5.0.0";
 
     //
     // *** SEE README ON GITHUB FOR PUBLIC API ***
     //
 
@@ -64,11 +64,10 @@ class AnsiUp
     private fg:AU_Color;
     private bg:AU_Color;
     private bold:boolean;
 
     private _use_classes:boolean;
-    private _escape_for_html;
 
     private _csi_regex:RegExp;
 
     private _osc_st:RegExp;
     private _osc_regex:RegExp;
@@ -80,11 +79,10 @@ class AnsiUp
     constructor()
     {
         // All construction occurs here
         this.setup_palettes();
         this._use_classes = false;
-        this._escape_for_html = true;
 
         this.bold = false;
         this.fg = this.bg = null;
 
         this._buffer = '';
@@ -100,20 +98,10 @@ class AnsiUp
     get use_classes():boolean
     {
         return this._use_classes;
     }
 
-    set escape_for_html(arg:boolean)
-    {
-        this._escape_for_html = arg;
-    }
-
-    get escape_for_html():boolean
-    {
-        return this._escape_for_html;
-    }
-
     set url_whitelist(arg:{})
     {
         this._url_whitelist = arg;
     }
 
@@ -181,14 +169,16 @@ class AnsiUp
         }
     }
 
     private escape_txt_for_html(txt:string):string
     {
-      return txt.replace(/[&<>]/gm, (str) => {
-        if (str === "&") return "&amp;";
-        if (str === "<") return "&lt;";
-        if (str === ">") return "&gt;";
+      return txt.replace(/[&<>"']/gm, (str) => {
+        if (str === "&")  return "&amp;";
+        if (str === "<")  return "&lt;";
+        if (str === ">")  return "&gt;";
+        if (str === "\"") return "&quot;";
+        if (str === "'")  return "&#x27;";
       });
     }
 
     private append_buffer(txt:string) {
 
@@ -629,12 +619,11 @@ class AnsiUp
         let txt = fragment.text;
 
         if (txt.length === 0)
             return txt;
 
-        if (this._escape_for_html)
-            txt = this.escape_txt_for_html(txt);
+        txt = this.escape_txt_for_html(txt);
 
         // If colors not set, default style is used
         if (!fragment.bold && fragment.fg === null && fragment.bg === null)
             return txt;
 
diff --git a/dist/ansi_up.d.ts b/dist/ansi_up.d.ts
index 20e08cb..7642764 100644
--- a/dist/ansi_up.d.ts
+++ b/dist/ansi_up.d.ts
@@ -28,20 +28,20 @@ export default class AnsiUp {
     private palette_256;
     private fg;
     private bg;
     private bold;
     private _use_classes;
-    private _escape_for_html;
     private _csi_regex;
     private _osc_st;
     private _osc_regex;
     private _url_whitelist;
     private _buffer;
     constructor();
-    use_classes: boolean;
-    escape_for_html: boolean;
-    url_whitelist: {};
+    set use_classes(arg: boolean);
+    get use_classes(): boolean;
+    set url_whitelist(arg: {});
+    get url_whitelist(): {};
     private setup_palettes;
     private escape_txt_for_html;
     private append_buffer;
     private get_next_packet;
     ansi_to_html(txt: string): string;
diff --git a/dist/ansi_up.js.include b/dist/ansi_up.js.include
index b42b385..54f78e8 100644
--- a/dist/ansi_up.js.include
+++ b/dist/ansi_up.js.include
@@ -13,14 +13,13 @@ var PacketKind;
     PacketKind[PacketKind["SGR"] = 5] = "SGR";
     PacketKind[PacketKind["OSCURL"] = 6] = "OSCURL";
 })(PacketKind || (PacketKind = {}));
 var AnsiUp = (function () {
     function AnsiUp() {
-        this.VERSION = "4.0.3";
+        this.VERSION = "5.0.0";
         this.setup_palettes();
         this._use_classes = false;
-        this._escape_for_html = true;
         this.bold = false;
         this.fg = this.bg = null;
         this._buffer = '';
         this._url_whitelist = { 'http': 1, 'https': 1 };
     }
@@ -29,31 +28,21 @@ var AnsiUp = (function () {
             return this._use_classes;
         },
         set: function (arg) {
             this._use_classes = arg;
         },
-        enumerable: true,
-        configurable: true
-    });
-    Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
-        get: function () {
-            return this._escape_for_html;
-        },
-        set: function (arg) {
-            this._escape_for_html = arg;
-        },
-        enumerable: true,
+        enumerable: false,
         configurable: true
     });
     Object.defineProperty(AnsiUp.prototype, "url_whitelist", {
         get: function () {
             return this._url_whitelist;
         },
         set: function (arg) {
             this._url_whitelist = arg;
         },
-        enumerable: true,
+        enumerable: false,
         configurable: true
     });
     AnsiUp.prototype.setup_palettes = function () {
         var _this = this;
         this.ansi_colors =
@@ -99,17 +88,21 @@ var AnsiUp = (function () {
             var gry = { rgb: [grey_level, grey_level, grey_level], class_name: 'truecolor' };
             this.palette_256.push(gry);
         }
     };
     AnsiUp.prototype.escape_txt_for_html = function (txt) {
-        return txt.replace(/[&<>]/gm, function (str) {
+        return txt.replace(/[&<>"']/gm, function (str) {
             if (str === "&")
                 return "&amp;";
             if (str === "<")
                 return "&lt;";
             if (str === ">")
                 return "&gt;";
+            if (str === "\"")
+                return "&quot;";
+            if (str === "'")
+                return "&#x27;";
         });
     };
     AnsiUp.prototype.append_buffer = function (txt) {
         var str = this._buffer + txt;
         this._buffer = str;
@@ -320,12 +313,11 @@ var AnsiUp = (function () {
     };
     AnsiUp.prototype.transform_to_html = function (fragment) {
         var txt = fragment.text;
         if (txt.length === 0)
             return txt;
-        if (this._escape_for_html)
-            txt = this.escape_txt_for_html(txt);
+        txt = this.escape_txt_for_html(txt);
         if (!fragment.bold && fragment.fg === null && fragment.bg === null)
             return txt;
         var styles = [];
         var classes = [];
         var fg = fragment.fg;
diff --git a/dist/ansi_up.js.map b/dist/ansi_up.js.map
index 6c66814..7e802b8 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;IA6BI;QA3BA,YAAO,GAAG,OAAO,CAAC;QA8Bd,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAE7B,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;IAOD,sBAAI,mCAAe;aAKnB;YAEI,OAAO,IAAI,CAAC,gBAAgB,CAAC;QACjC,CAAC;aARD,UAAoB,GAAW;YAE3B,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;QAChC,CAAC;;;OAAA;IAOD,sBAAI,iCAAa;aAKjB;YAEI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of file
diff --git a/package.json b/package.json
index 3ec9ac9..351389d 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
 {
   "name": "ansi_up",
-  "version": "4.0.3",
+  "version": "5.0.0",
   "description": "Convert ansi sequences in strings to colorful HTML",
   "keywords": [
     "ansi",
     "html"
   ],
diff --git a/test/ansi_up-test.js b/test/ansi_up-test.js
index 0a7f623..2225029 100644
--- a/test/ansi_up-test.js
+++ b/test/ansi_up-test.js
@@ -110,150 +110,21 @@ describe('ansi_up', function () {
 
     describe('mixed characters', function () {
 
       it('should escape a mix of characters that require escaping', function () {
         var start = "<&>/\\'\"";
-        var expected = "&lt;&amp;&gt;/\\'\"";
+        var expected = "&lt;&amp;&gt;/\\&#x27;&quot;";
 
         var au = new AnsiUp();
         var l = au.ansi_to_html(start);
         l.should.eql(expected);
       });
 
     });
 
   });
 
-  describe('escape_for_html off', function () {
-
-    describe('ampersands', function () {
-
-      it('should escape a single ampersand', function () {
-        var start = "&";
-        var expected = "&";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape some text with ampersands', function () {
-        var start = "abcd&efgh";
-        var expected = "abcd&efgh";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape multiple ampersands', function () {
-        var start = " & & ";
-        var expected = " & & ";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape an already escaped ampersand', function () {
-        var start = " &amp; ";
-        var expected = " &amp; ";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-    });
-
-    describe('less-than', function () {
-
-      it('should escape a single less-than', function () {
-        var start = "<";
-        var expected = "<";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape some text with less-thans', function () {
-        var start = "abcd<efgh";
-        var expected = "abcd<efgh";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape multiple less-thans', function () {
-        var start = " < < ";
-        var expected = " < < ";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-    });
-
-    describe('greater-than', function () {
-
-      it('should escape a single greater-than', function () {
-        var start = ">";
-        var expected = ">";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape some text with greater-thans', function () {
-        var start = "abcd>efgh";
-        var expected = "abcd>efgh";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-      it('should escape multiple greater-thans', function () {
-        var start = " > > ";
-        var expected = " > > ";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-    });
-
-    describe('mixed characters', function () {
-
-      it('should escape a mix of characters that require escaping', function () {
-        var start = "<&>/\\'\"";
-        var expected = "<&>/\\'\"";
-
-        var au = new AnsiUp();
-        au.escape_for_html = false;
-        var l = au.ansi_to_html(start);
-        l.should.eql(expected);
-      });
-
-    });
-
-  });
-
   describe('hyperlinks', function () {
 
     it('should create an anchor tag with ST', function () {
       var start = "ABC \x1b]8;;http://example.com\x1b\\EXAMPLE\x1b]8;;\x1b\\ DEF"
       var expected = "ABC <a href=\"http://example.com\">EXAMPLE</a> DEF";

Vulnerable code: #### escape_for_html
(default: true)

This does the minimum escaping of text to make it compliant with HTML.
In particular, the '&','<', and '>' characters are escaped. It is
** highly ** recommended that you do not set this to false. It will open
the door security vulnerabilities.

In general, the ansi_to_html *should* emit HTML when invoked with a non-empty string.
The only exceptions are an incomplete ESC sequence or an incomplete escaped URL.
For those cases, the library will buffer the escape or the sequence for the escaped URL.

The library is also stateful. If a color is set in a prior invocation, then it will
continue to emit that color in further invocations until the color/SGR attribute is changed.
        this.VERSION = "4.0.3";
        this._escape_for_html = true;
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
        get: function () {
            return this._escape_for_html;
        },
        set: function (arg) {
            this._escape_for_html = arg;
        },
        enumerable: true,
        enumerable: true,
        return txt.replace(/[&<>]/gm, function (str) {
        if (this._escape_for_html)
            txt = this.escape_txt_for_html(txt);
    VERSION = "4.0.3";
    private _escape_for_html;
        this._escape_for_html = true;
    set escape_for_html(arg:boolean)
    {
        this._escape_for_html = arg;
    }

    get escape_for_html():boolean
    {
        return this._escape_for_html;
    }

      return txt.replace(/[&<>]/gm, (str) => {
        if (str === "&") return "&amp;";
        if (str === "<") return "&lt;";
        if (str === ">") return "&gt;";
        if (this._escape_for_html)
            txt = this.escape_txt_for_html(txt);
    private _escape_for_html;
    use_classes: boolean;
    escape_for_html: boolean;
    url_whitelist: {};
        this.VERSION = "4.0.3";
        this._escape_for_html = true;
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
        get: function () {
            return this._escape_for_html;
        },
        set: function (arg) {
            this._escape_for_html = arg;
        },
        enumerable: true,
        enumerable: true,
        return txt.replace(/[&<>]/gm, function (str) {
        if (this._escape_for_html)
            txt = this.escape_txt_for_html(txt);
{"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;IA6BI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AAI,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,AAzoBD,IAyoBC;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"}
  "version": "4.0.3",
        var expected = "&lt;&amp;&gt;/\\'\"";
  describe('escape_for_html off', function () {

    describe('ampersands', function () {

      it('should escape a single ampersand', function () {
        var start = "&";
        var expected = "&";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape some text with ampersands', function () {
        var start = "abcd&efgh";
        var expected = "abcd&efgh";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape multiple ampersands', function () {
        var start = " & & ";
        var expected = " & & ";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape an already escaped ampersand', function () {
        var start = " &amp; ";
        var expected = " &amp; ";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });
    });

    describe('less-than', function () {

      it('should escape a single less-than', function () {
        var start = "<";
        var expected = "<";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape some text with less-thans', function () {
        var start = "abcd<efgh";
        var expected = "abcd<efgh";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape multiple less-thans', function () {
        var start = " < < ";
        var expected = " < < ";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

    });

    describe('greater-than', function () {

      it('should escape a single greater-than', function () {
        var start = ">";
        var expected = ">";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape some text with greater-thans', function () {
        var start = "abcd>efgh";
        var expected = "abcd>efgh";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

      it('should escape multiple greater-thans', function () {
        var start = " > > ";
        var expected = " > > ";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

    });

    describe('mixed characters', function () {

      it('should escape a mix of characters that require escaping', function () {
        var start = "<&>/\\'\"";
        var expected = "<&>/\\'\"";

        var au = new AnsiUp();
        au.escape_for_html = false;
        var l = au.ansi_to_html(start);
        l.should.eql(expected);
      });

    });

  });

Fixed code: In general, the ansi_to_html *should* emit HTML output when invoked with a non-empty string.
The only exceptions are an incomplete ESC sequence or an incomplete OSC URL sequence.
For those cases, the library will buffer (not emit output), until it receives input that completes those sequences.
0.1
        this.VERSION = "5.0.0";
        enumerable: false,
        enumerable: false,
        return txt.replace(/[&<>"']/gm, function (str) {
            if (str === "\"")
                return "&quot;";
            if (str === "'")
                return "&#x27;";
        txt = this.escape_txt_for_html(txt);
    VERSION = "5.0.0";
      return txt.replace(/[&<>"']/gm, (str) => {
        if (str === "&")  return "&amp;";
        if (str === "<")  return "&lt;";
        if (str === ">")  return "&gt;";
        if (str === "\"") return "&quot;";
        if (str === "'")  return "&#x27;";
        txt = this.escape_txt_for_html(txt);
    set use_classes(arg: boolean);
    get use_classes(): boolean;
    set url_whitelist(arg: {});
    get url_whitelist(): {};
        this.VERSION = "5.0.0";
        enumerable: false,
        enumerable: false,
        return txt.replace(/[&<>"']/gm, function (str) {
            if (str === "\"")
                return "&quot;";
            if (str === "'")
                return "&#x27;";
        txt = this.escape_txt_for_html(txt);
{"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;IA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