From 5761c7ca62bd0a08ac45c90986786942dbdc43dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Mon, 25 Apr 2022 08:27:36 +0100 Subject: [PATCH] fixes and closes #920 --- src/helpers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 6652cff..14d8d59 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -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();