Skip to content

Commit

Permalink
Update version for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
drudru committed Mar 31, 2023
1 parent a2af6b0 commit abae359
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
15 changes: 14 additions & 1 deletion ansi_up.js
Expand Up @@ -34,7 +34,7 @@ var PacketKind;
})(PacketKind || (PacketKind = {}));
var AnsiUp = (function () {
function AnsiUp() {
this.VERSION = "5.1.0";
this.VERSION = "5.2.0";
this.setup_palettes();
this._use_classes = false;
this.bold = false;
Expand All @@ -43,6 +43,7 @@ var AnsiUp = (function () {
this.fg = this.bg = null;
this._buffer = '';
this._url_whitelist = { 'http': 1, 'https': 1 };
this._escape_html = true;
}
Object.defineProperty(AnsiUp.prototype, "use_classes", {
get: function () {
Expand All @@ -64,6 +65,16 @@ var AnsiUp = (function () {
enumerable: false,
configurable: true
});
Object.defineProperty(AnsiUp.prototype, "escape_html", {
get: function () {
return this._escape_html;
},
set: function (arg) {
this._escape_html = arg;
},
enumerable: false,
configurable: true
});
AnsiUp.prototype.setup_palettes = function () {
var _this = this;
this.ansi_colors =
Expand Down Expand Up @@ -111,6 +122,8 @@ var AnsiUp = (function () {
}
};
AnsiUp.prototype.escape_txt_for_html = function (txt) {
if (!this._escape_html)
return txt;
return txt.replace(/[&<>"']/gm, function (str) {
if (str === "&")
return "&amp;";
Expand Down
2 changes: 1 addition & 1 deletion ansi_up.ts
Expand Up @@ -52,7 +52,7 @@ interface TextPacket {

class AnsiUp
{
VERSION = "5.1.0";
VERSION = "5.2.0";

//
// *** SEE README ON GITHUB FOR PUBLIC API ***
Expand Down
3 changes: 3 additions & 0 deletions dist/ansi_up.d.ts
Expand Up @@ -38,12 +38,15 @@ export default class AnsiUp {
private _osc_st;
private _osc_regex;
private _url_whitelist;
private _escape_html;
private _buffer;
constructor();
set use_classes(arg: boolean);
get use_classes(): boolean;
set url_whitelist(arg: {});
get url_whitelist(): {};
set escape_html(arg: boolean);
get escape_html(): boolean;
private setup_palettes;
private escape_txt_for_html;
private append_buffer;
Expand Down
15 changes: 14 additions & 1 deletion dist/ansi_up.js.include
Expand Up @@ -15,7 +15,7 @@ var PacketKind;
})(PacketKind || (PacketKind = {}));
var AnsiUp = (function () {
function AnsiUp() {
this.VERSION = "5.1.0";
this.VERSION = "5.2.0";
this.setup_palettes();
this._use_classes = false;
this.bold = false;
Expand All @@ -24,6 +24,7 @@ var AnsiUp = (function () {
this.fg = this.bg = null;
this._buffer = '';
this._url_whitelist = { 'http': 1, 'https': 1 };
this._escape_html = true;
}
Object.defineProperty(AnsiUp.prototype, "use_classes", {
get: function () {
Expand All @@ -45,6 +46,16 @@ var AnsiUp = (function () {
enumerable: false,
configurable: true
});
Object.defineProperty(AnsiUp.prototype, "escape_html", {
get: function () {
return this._escape_html;
},
set: function (arg) {
this._escape_html = arg;
},
enumerable: false,
configurable: true
});
AnsiUp.prototype.setup_palettes = function () {
var _this = this;
this.ansi_colors =
Expand Down Expand Up @@ -92,6 +103,8 @@ var AnsiUp = (function () {
}
};
AnsiUp.prototype.escape_txt_for_html = function (txt) {
if (!this._escape_html)
return txt;
return txt.replace(/[&<>"']/gm, function (str) {
if (str === "&")
return "&amp;";
Expand Down
2 changes: 1 addition & 1 deletion dist/ansi_up.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ansi_up",
"version": "5.1.0",
"version": "5.2.0",
"description": "Convert ansi sequences in strings to colorful HTML",
"keywords": [
"ansi",
Expand Down

0 comments on commit abae359

Please sign in to comment.