Skip to content

Commit

Permalink
add typing for parse_formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 9, 2022
1 parent ec2c6df commit 2ffe42f
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 48 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@
### Features
* add insert typing animation
* add `--text-shadow` css variable
* new API method `parse_formatting`
### Bugfix
* fix calculating number of rows (affecting less command)
* fix glow with prism and error messages [#729](https://github.com/jcubic/jquery.terminal/issues/729)
Expand Down
30 changes: 15 additions & 15 deletions js/jquery.terminal-2.31.1.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 09 Feb 2022 15:15:07 +0000
* Date: Wed, 09 Feb 2022 15:22:46 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5138,7 +5138,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 09 Feb 2022 15:15:07 +0000',
date: 'Wed, 09 Feb 2022 15:22:46 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -6146,19 +6146,6 @@
}
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: Replace terminal formatting with html
// ---------------------------------------------------------------------
format: function format(str, options) {
Expand Down Expand Up @@ -6673,6 +6660,19 @@
return result;
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: function executed for each text inside [[ .... ]] in echo
// ---------------------------------------------------------------------
extended_command: function extended_command(term, string, options) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.31.1.min.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions js/jquery.terminal-src.js
Expand Up @@ -6146,19 +6146,6 @@
}
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: Replace terminal formatting with html
// ---------------------------------------------------------------------
format: function format(str, options) {
Expand Down Expand Up @@ -6673,6 +6660,19 @@
return result;
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: function executed for each text inside [[ .... ]] in echo
// ---------------------------------------------------------------------
extended_command: function extended_command(term, string, options) {
Expand Down
1 change: 1 addition & 0 deletions js/jquery.terminal.d.ts
Expand Up @@ -498,6 +498,7 @@ interface JQueryTerminalStatic {
parse_command(str: string): JQueryTerminal.ParsedCommand<number | RegExp | string>;
split_command(str: string): JQueryTerminal.ParsedCommand<string>;
parse_options(arg: string | string[], options?: { booleans: string[] }): JQueryTerminal.ParsedOptions;
parse_formatting(arg: string): string[];
extended_command(term: JQueryTerminal, str: string): void;
/**
* formatter is an object that can be used in RegExp functions
Expand Down
30 changes: 15 additions & 15 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 09 Feb 2022 15:15:07 +0000
* Date: Wed, 09 Feb 2022 15:22:46 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5138,7 +5138,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 09 Feb 2022 15:15:07 +0000',
date: 'Wed, 09 Feb 2022 15:22:46 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -6146,19 +6146,6 @@
}
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: Replace terminal formatting with html
// ---------------------------------------------------------------------
format: function format(str, options) {
Expand Down Expand Up @@ -6673,6 +6660,19 @@
return result;
},
// ---------------------------------------------------------------------
// :: helper function that return array of formatting
// :: it handles html entites inside text #735
// ---------------------------------------------------------------------
parse_formatting: function(string) {
var formatting = $.terminal.unescape_brackets(string).split(';');
var text_part = 4;
if (formatting.length >= 5) {
var escaped = $.terminal.escape_brackets(formatting[text_part]);
formatting[text_part] = escaped;
}
return formatting;
},
// ---------------------------------------------------------------------
// :: function executed for each text inside [[ .... ]] in echo
// ---------------------------------------------------------------------
extended_command: function extended_command(term, string, options) {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 2ffe42f

Please sign in to comment.