From 8458221cee3da464f74269ad07b0bc7d665c684f Mon Sep 17 00:00:00 2001 From: RoXoM Date: Thu, 30 Nov 2023 23:41:06 +0800 Subject: [PATCH] refactor: use encodeURIComponent to encode story name --- code/ui/blocks/src/blocks/Subheading.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ui/blocks/src/blocks/Subheading.tsx b/code/ui/blocks/src/blocks/Subheading.tsx index 02f35bf63fdf..57cf5223be51 100644 --- a/code/ui/blocks/src/blocks/Subheading.tsx +++ b/code/ui/blocks/src/blocks/Subheading.tsx @@ -8,7 +8,7 @@ export const Subheading: FC> = ({ children, disa if (disableAnchor || typeof children !== 'string') { return

{children}

; } - const tagID = children.toLowerCase().replace(/[^a-z0-9]/gi, '-'); + const tagID = globalThis.encodeURIComponent(children.toLowerCase()); return ( {children}