We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5a8bca commit 7124552Copy full SHA for 7124552
lib/hosts.js
@@ -6,7 +6,7 @@ const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : ''
6
const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : ''
7
const formatHashFragment = (f) => f.toLowerCase()
8
.replace(/^\W+/g, '') // strip leading non-characters
9
- .replace(/\W+$/g, '') // strip trailing non-characters
+ .replace(/(?<!\W)\W+$/, '') // strip trailing non-characters
10
.replace(/\//g, '') // strip all slashes
11
.replace(/\W+/g, '-') // replace remaining non-characters with '-'
12
0 commit comments