Skip to content

Commit

Permalink
rename whitelist acceptlist
Browse files Browse the repository at this point in the history
  • Loading branch information
drudru committed Aug 14, 2023
1 parent ad72b8f commit e16e2d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions ansi_up.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export declare class AnsiUp {
private _csi_regex;
private _osc_st;
private _osc_regex;
private _url_whitelist;
private _url_acceptlist;
private _escape_html;
private _buffer;
private _boldStyle;
Expand All @@ -22,8 +22,8 @@ export declare class AnsiUp {
constructor();
set use_classes(arg: boolean);
get use_classes(): boolean;
set url_whitelist(arg: {});
get url_whitelist(): {};
set url_acceptlist(arg: {});
get url_acceptlist(): {};
set escape_html(arg: boolean);
get escape_html(): boolean;
set boldStyle(arg: string);
Expand Down
12 changes: 6 additions & 6 deletions ansi_up.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class AnsiUp {
this.underline = false;
this.fg = this.bg = null;
this._buffer = '';
this._url_whitelist = { 'http': 1, 'https': 1 };
this._url_acceptlist = { 'http': 1, 'https': 1 };
this._escape_html = true;
this.boldStyle = 'font-weight:bold';
this.faintStyle = 'opacity:0.7';
Expand All @@ -37,11 +37,11 @@ export class AnsiUp {
get use_classes() {
return this._use_classes;
}
set url_whitelist(arg) {
this._url_whitelist = arg;
set url_acceptlist(arg) {
this._url_acceptlist = arg;
}
get url_whitelist() {
return this._url_whitelist;
get url_acceptlist() {
return this._url_acceptlist;
}
set escape_html(arg) {
this._escape_html = arg;
Expand Down Expand Up @@ -409,7 +409,7 @@ export class AnsiUp {
let parts = pkt.url.split(':');
if (parts.length < 1)
return '';
if (!this._url_whitelist[parts[0]])
if (!this._url_acceptlist[parts[0]])
return '';
let result = `<a href="${this.escape_txt_for_html(pkt.url)}">${this.escape_txt_for_html(pkt.text)}</a>`;
return result;
Expand Down
14 changes: 7 additions & 7 deletions ansi_up.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class AnsiUp
private _osc_st:RegExp;
private _osc_regex:RegExp;

private _url_whitelist:{};
private _url_acceptlist:{};
private _escape_html:boolean;

private _buffer:string;
Expand All @@ -102,7 +102,7 @@ export class AnsiUp

this._buffer = '';

this._url_whitelist = { 'http':1, 'https':1 };
this._url_acceptlist = { 'http':1, 'https':1 };
this._escape_html = true;

this.boldStyle = 'font-weight:bold';
Expand All @@ -121,14 +121,14 @@ export class AnsiUp
return this._use_classes;
}

set url_whitelist(arg:{})
set url_acceptlist(arg:{})
{
this._url_whitelist = arg;
this._url_acceptlist = arg;
}

get url_whitelist():{}
get url_acceptlist():{}
{
return this._url_whitelist;
return this._url_acceptlist;
}

set escape_html(arg:boolean)
Expand Down Expand Up @@ -746,7 +746,7 @@ export class AnsiUp
if (parts.length < 1)
return '';

if (! this._url_whitelist[parts[0]])
if (! this._url_acceptlist[parts[0]])
return '';

let result = `<a href="${this.escape_txt_for_html(pkt.url)}">${this.escape_txt_for_html(pkt.text)}</a>`;
Expand Down

0 comments on commit e16e2d9

Please sign in to comment.