Add GitHub Pages content in Markdown support (#5522)
* add `allowedHostnameSuffixes` with `.github.io` support * apply `prettier` --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
@@ -109,7 +109,12 @@ 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,
|
||||
|
||||
Reference in New Issue
Block a user