Skip to content

Commit

Permalink
allow using Object URLs in links #982
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 2, 2024
1 parent be21248 commit 4b7fe96
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 2.45.0
### Features
* add `id` option that allow to create same terminal using hot reload [#978](https://github.com/jcubic/jquery.terminal/issues/978)
* allow using Object URLs in links [#982](https://github.com/jcubic/jquery.terminal/issues/982)
### Bugfix
* fix `terminal::login()` when user already authenticated [#980](https://github.com/jcubic/jquery.terminal/issues/980)

Expand Down
8 changes: 4 additions & 4 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@
var format_end_re = /\[\[(?:-?[@!gbiusor])*;[^;]*;[^\]]*\]?$/i;
var self_closing_re = /^(?:\[\[)?[^;]*@[^;]*;/;
var color_re = /^(?:#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/i;
var url_re = /(\b(?:file|ftp|https?):\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'\\<>\][)])+)/gi;
var url_re = /(\b(?:file|ftp|https?|blog:https?):\/\/(?:[^/\s]+\.[^/\s.]+)(?:\/[^\s]*)?(?:#[^\s]*)?)/gi;
var url_nf_re = /\b(?![^"\s[\]]*])(https?:\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'\\<>\][)])+)/gi;
var email_re = /((([^<>('")[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))/g;
var url_full_re = /^(https?:\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'<>\\\][)])+)$/gi;
Expand Down Expand Up @@ -6848,8 +6848,8 @@
}
var test = fn(url);
if (!test) {
warn('Invalid URL ' + url + ' only http(s) ftp and path ' +
'are allowed');
warn('Invalid URL ' + url + ' only http(s), blob, ftp, and ' +
'paths are allowed!');
}
return test;
};
Expand All @@ -6868,7 +6868,7 @@
}, options || {});
// -----------------------------------------------------------------
var valid_href = with_url_validation(function(url) {
return url.match(/^((https?|file|ftp):\/\/|\.{0,2}\/)/) || is_path(url);
return url.match(/^(((?:blob:)?https?|file|ftp):\/\/|\.{0,2}\/)/) || is_path(url);

Check failure on line 6871 in js/jquery.terminal-src.js

View workflow job for this annotation

GitHub Actions / build

This line has a length of 98. Maximum allowed is 90
}, settings);
// -----------------------------------------------------------------
var valid_src = with_url_validation(function(url) {
Expand Down
12 changes: 6 additions & 6 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: Tue, 29 Oct 2024 22:55:22 +0000
* Date: Sat, 02 Nov 2024 21:30:07 +0000
*/
/* global define, Map, BigInt */
/* eslint-disable */
Expand Down Expand Up @@ -1210,7 +1210,7 @@
var format_end_re = /\[\[(?:-?[@!gbiusor])*;[^;]*;[^\]]*\]?$/i;
var self_closing_re = /^(?:\[\[)?[^;]*@[^;]*;/;
var color_re = /^(?:#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/i;
var url_re = /(\b(?:file|ftp|https?):\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'\\<>\][)])+)/gi;
var url_re = /(\b(?:file|ftp|https?|blog:https?):\/\/(?:[^/\s]+\.[^/\s.]+)(?:\/[^\s]*)?(?:#[^\s]*)?)/gi;
var url_nf_re = /\b(?![^"\s[\]]*])(https?:\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'\\<>\][)])+)/gi;
var email_re = /((([^<>('")[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))/g;
var url_full_re = /^(https?:\/\/(?:(?:(?!&[^;]+;)|(?=&amp;))[^\s"'<>\\\][)])+)$/gi;
Expand Down Expand Up @@ -5350,7 +5350,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Tue, 29 Oct 2024 22:55:22 +0000',
date: 'Sat, 02 Nov 2024 21:30:07 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -6848,8 +6848,8 @@
}
var test = fn(url);
if (!test) {
warn('Invalid URL ' + url + ' only http(s) ftp and path ' +
'are allowed');
warn('Invalid URL ' + url + ' only http(s), blob, ftp, and ' +
'paths are allowed!');
}
return test;
};
Expand All @@ -6868,7 +6868,7 @@
}, options || {});
// -----------------------------------------------------------------
var valid_href = with_url_validation(function(url) {
return url.match(/^((https?|file|ftp):\/\/|\.{0,2}\/)/) || is_path(url);
return url.match(/^(((?:blob:)?https?|file|ftp):\/\/|\.{0,2}\/)/) || is_path(url);
}, settings);
// -----------------------------------------------------------------
var valid_src = with_url_validation(function(url) {
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 4b7fe96

Please sign in to comment.