Skip to content

Commit

Permalink
fix iterate formatting over closing bracket #792
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jun 12, 2022
1 parent 5cdc415 commit 886dc38
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
10 changes: 6 additions & 4 deletions js/jquery.terminal-2.33.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 12 Jun 2022 18:58:05 +0000
* Date: Sun, 12 Jun 2022 20:32:54 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5212,7 +5212,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 12 Jun 2022 18:58:05 +0000',
date: 'Sun, 12 Jun 2022 20:32:54 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5418,8 +5418,8 @@
}
// ----------------------------------------------------------------
function is_text(i) {
return not_formatting && (string[i] !== ']' || !have_formatting)
&& !opening;
return not_formatting && !opening &&
((string[i] !== ']' && !closing_formatting) || !have_formatting);
}
// ----------------------------------------------------------------
// :: function will skip to next character in main loop
Expand Down Expand Up @@ -5465,12 +5465,14 @@
var re_ent = /(&[^;]+);$/;
for (var i = 0; i < string.length; i++) {
var substring = string.slice(i);
var closing_formatting = false;
match = substring.match(format_start_re);
if (match) {
formatting = match[1];
in_text = false;
} else if (formatting) {
if (string[i] === ']') {
closing_formatting = in_text;
if (in_text) {
formatting = '';
in_text = false;
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.33.3.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -5418,8 +5418,8 @@
}
// ----------------------------------------------------------------
function is_text(i) {
return not_formatting && (string[i] !== ']' || !have_formatting)
&& !opening;
return not_formatting && !opening &&
((string[i] !== ']' && !closing_formatting) || !have_formatting);
}
// ----------------------------------------------------------------
// :: function will skip to next character in main loop
Expand Down Expand Up @@ -5465,12 +5465,14 @@
var re_ent = /(&[^;]+);$/;
for (var i = 0; i < string.length; i++) {
var substring = string.slice(i);
var closing_formatting = false;
match = substring.match(format_start_re);
if (match) {
formatting = match[1];
in_text = false;
} else if (formatting) {
if (string[i] === ']') {
closing_formatting = in_text;
if (in_text) {
formatting = '';
in_text = false;
Expand Down
10 changes: 6 additions & 4 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Sun, 12 Jun 2022 18:58:05 +0000
* Date: Sun, 12 Jun 2022 20:32:54 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5212,7 +5212,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Sun, 12 Jun 2022 18:58:05 +0000',
date: 'Sun, 12 Jun 2022 20:32:54 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5418,8 +5418,8 @@
}
// ----------------------------------------------------------------
function is_text(i) {
return not_formatting && (string[i] !== ']' || !have_formatting)
&& !opening;
return not_formatting && !opening &&
((string[i] !== ']' && !closing_formatting) || !have_formatting);
}
// ----------------------------------------------------------------
// :: function will skip to next character in main loop
Expand Down Expand Up @@ -5465,12 +5465,14 @@
var re_ent = /(&[^;]+);$/;
for (var i = 0; i < string.length; i++) {
var substring = string.slice(i);
var closing_formatting = false;
match = substring.match(format_start_re);
if (match) {
formatting = match[1];
in_text = false;
} else if (formatting) {
if (string[i] === ']') {
closing_formatting = in_text;
if (in_text) {
formatting = '';
in_text = false;
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 886dc38

Please sign in to comment.