From 4f3bbf69512e6c3ada45fe5767e8688be1de3d69 Mon Sep 17 00:00:00 2001 From: code-lime Date: Tue, 10 Mar 2026 23:47:02 +0300 Subject: [PATCH 1/2] add `allowedHostnameSuffixes` with `.github.io` support --- packages/utils/parse.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/utils/parse.ts b/packages/utils/parse.ts index d981d07b27..2741e2f245 100644 --- a/packages/utils/parse.ts +++ b/packages/utils/parse.ts @@ -109,7 +109,11 @@ export const configuredXss = new FilterXSS({ 'bstats.org', ] - if (!allowedHostnames.includes(url.hostname)) { + const allowedHostnameSuffixes = [ + ".github.io", + ] + + if (!allowedHostnames.includes(url.hostname) && !allowedHostnameSuffixes.some(suffix => url.hostname.endsWith(suffix))) { return safeAttrValue( tag, name, From 68dd6c83cf1d8fcf17c3a0311048691027645c7e Mon Sep 17 00:00:00 2001 From: code-lime Date: Thu, 12 Mar 2026 03:40:54 +0300 Subject: [PATCH 2/2] apply `prettier` --- packages/utils/parse.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/utils/parse.ts b/packages/utils/parse.ts index 2741e2f245..646caa5ae7 100644 --- a/packages/utils/parse.ts +++ b/packages/utils/parse.ts @@ -109,11 +109,12 @@ export const configuredXss = new FilterXSS({ 'bstats.org', ] - const allowedHostnameSuffixes = [ - ".github.io", - ] + const allowedHostnameSuffixes = ['.github.io'] - if (!allowedHostnames.includes(url.hostname) && !allowedHostnameSuffixes.some(suffix => url.hostname.endsWith(suffix))) { + if ( + !allowedHostnames.includes(url.hostname) && + !allowedHostnameSuffixes.some((suffix) => url.hostname.endsWith(suffix)) + ) { return safeAttrValue( tag, name,