Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ephox/polaris

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ephox/polaris - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

5

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## 5.0.3 - 2022-09-14
### Fixed
- Fixed incorrect `Regexes.link` URL detection for path segments that contain valid characters such as `!` and `:` #TINY-5074
## 5.0.2 - 2021-10-11

@@ -11,0 +16,0 @@

5

lib/main/ts/ephox/polaris/api/Regexes.js

@@ -30,2 +30,3 @@ /*

- reduced duplication (TINY-5074)
- allow [*!;:'@$] in the path segment as they are valid characters per the spec: https://url.spec.whatwg.org/#url-path-segment-string (TINY-8069)

@@ -45,3 +46,3 @@ (?:

(?:
[-+~=.,%()\/\w]*[-+~=%()\/\w]
[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w]
)?

@@ -64,3 +65,3 @@ )?

// eslint-disable-next-line max-len
return /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
return /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
};

@@ -67,0 +68,0 @@ var autolink = function () {

14

lib/test/ts/atomic/api/RegexesTest.js

@@ -23,3 +23,5 @@ import { assert, UnitTest } from '@ephox/bedrock-client';

'https://www.amazon.com.au/gp/product/B0798R2WXG/ref=s9_acsd_top_hd_bw_b5QhTfX_c_x_w?pf_rd_m=ANEGB3WVEVKZB&pf_rd_s=merchandised-search-4&pf_rd_r=KF6SD7C0M69MKF2FR9CC&pf_rd_t=101&pf_rd_p=8ad3bdba-b846-5350-9c00-72c2cb7191dd&pf_rd_i=4975211051',
'https://www.birddoctor.net/refId,56511/refDownload.pml'
'https://www.birddoctor.net/refId,56511/refDownload.pml',
'https://www.example.com/:w:/s/b026324c6904b2a9cb4b88d6d61c81d1?q=abc123',
'https://website.com/test/!test'
];

@@ -242,2 +244,3 @@ // More cases, http://formvalidation.io/validators/uri/

});
// Ignore trailing punctuation such as a comma, period and exclamation mark at the end of the URL path
var onlyWithPathLinks = {

@@ -247,2 +250,5 @@ 'http://google.com': 'http://google.com',

'http://google.com,': 'http://google.com',
'http://google.com!': 'http://google.com',
'http://google.com;': 'http://google.com',
'http://google.com:': 'http://google.com',
'http://google.com/,': 'http://google.com/',

@@ -252,2 +258,5 @@ 'http://google.com/,,': 'http://google.com/',

'http://google.com/..': 'http://google.com/',
'http://google.com/!': 'http://google.com/',
'http://google.com/:': 'http://google.com/',
'http://google.com/;': 'http://google.com/',
'http://google.com/,/': 'http://google.com/,/',

@@ -258,2 +267,5 @@ 'http://google.com/,/,': 'http://google.com/,/',

'http://google.com/abc.': 'http://google.com/abc',
'http://google.com/abc!': 'http://google.com/abc',
'http://google.com/abc;': 'http://google.com/abc',
'http://google.com/abc:': 'http://google.com/abc',
'http://google.com/,ab,c': 'http://google.com/,ab,c',

@@ -260,0 +272,0 @@ 'http://google.com/ab,c': 'http://google.com/ab,c',

{
"name": "@ephox/polaris",
"description": "This project does data manipulation on arrays and strings.",
"version": "5.0.3",
"version": "5.0.4",
"repository": {

@@ -39,3 +39,3 @@ "type": "git",

"types": "./lib/main/ts/ephox/polaris/api/Main.d.ts",
"gitHead": "4e954bfe34d4817c6e08997e24ec5c4580836c9f"
"gitHead": "f058ea7368c558864b9c2ac64ebcddecd4bbd2c0"
}

@@ -31,2 +31,3 @@

- reduced duplication (TINY-5074)
- allow [*!;:'@$] in the path segment as they are valid characters per the spec: https://url.spec.whatwg.org/#url-path-segment-string (TINY-8069)

@@ -46,3 +47,3 @@ (?:

(?:
[-+~=.,%()\/\w]*[-+~=%()\/\w]
[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w]
)?

@@ -66,3 +67,3 @@ )?

// eslint-disable-next-line max-len
/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;

@@ -69,0 +70,0 @@ const autolink = (): RegExp => {

@@ -25,3 +25,5 @@ import { assert, UnitTest } from '@ephox/bedrock-client';

'https://www.amazon.com.au/gp/product/B0798R2WXG/ref=s9_acsd_top_hd_bw_b5QhTfX_c_x_w?pf_rd_m=ANEGB3WVEVKZB&pf_rd_s=merchandised-search-4&pf_rd_r=KF6SD7C0M69MKF2FR9CC&pf_rd_t=101&pf_rd_p=8ad3bdba-b846-5350-9c00-72c2cb7191dd&pf_rd_i=4975211051',
'https://www.birddoctor.net/refId,56511/refDownload.pml'
'https://www.birddoctor.net/refId,56511/refDownload.pml',
'https://www.example.com/:w:/s/b026324c6904b2a9cb4b88d6d61c81d1?q=abc123',
'https://website.com/test/!test'
];

@@ -257,6 +259,10 @@

const onlyWithPathLinks = { // Ignore trailing comma and period in URL path
// Ignore trailing punctuation such as a comma, period and exclamation mark at the end of the URL path
const onlyWithPathLinks = {
'http://google.com': 'http://google.com',
'http://google.com.': 'http://google.com',
'http://google.com,': 'http://google.com',
'http://google.com!': 'http://google.com',
'http://google.com;': 'http://google.com',
'http://google.com:': 'http://google.com',
'http://google.com/,': 'http://google.com/',

@@ -266,2 +272,5 @@ 'http://google.com/,,': 'http://google.com/',

'http://google.com/..': 'http://google.com/',
'http://google.com/!': 'http://google.com/',
'http://google.com/:': 'http://google.com/',
'http://google.com/;': 'http://google.com/',
'http://google.com/,/': 'http://google.com/,/',

@@ -272,2 +281,5 @@ 'http://google.com/,/,': 'http://google.com/,/',

'http://google.com/abc.': 'http://google.com/abc',
'http://google.com/abc!': 'http://google.com/abc',
'http://google.com/abc;': 'http://google.com/abc',
'http://google.com/abc:': 'http://google.com/abc',
'http://google.com/,ab,c': 'http://google.com/,ab,c',

@@ -274,0 +286,0 @@ 'http://google.com/ab,c': 'http://google.com/ab,c',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc