fixes and closes #920

This commit is contained in:
Estevão Soares dos Santos 2022-04-25 08:27:36 +01:00
parent 4db74176da
commit 5761c7ca62

View File

@ -549,11 +549,10 @@ showdown.helper.isAbsolutePath = function (path) {
};
showdown.helper.URLUtils = function (url, baseURL) {
const pattern1 = /^\s+|\s+$/g;
const pattern2 = /^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/;
let m = String(url)
.replace(pattern1, '')
.trim()
.match(pattern2);
if (!m) {
throw new RangeError();