From b9a4528a7c4662004cf1b2c710cdc131dfab7c66 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 21 Nov 2024 12:41:10 -0800 Subject: [PATCH] fix: even better regex for host fragment --- lib/hosts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hosts.js b/lib/hosts.js index da10edf..2a88e95 100644 --- a/lib/hosts.js +++ b/lib/hosts.js @@ -6,7 +6,7 @@ const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' const formatHashFragment = (f) => f.toLowerCase() .replace(/^\W+/g, '') // strip leading non-characters - .replace(/\W+$/g, '') // strip trailing non-characters + .replace(/(?