From 9c9d3385c828d6ed820f056a2bbb3f5cf86aa1cb Mon Sep 17 00:00:00 2001 From: sup39 Date: Sun, 6 Nov 2022 17:07:20 +0900 Subject: [PATCH] fix mdx --- components/mdx.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/mdx.tsx b/components/mdx.tsx index c34a42d..f86ff6b 100644 --- a/components/mdx.tsx +++ b/components/mdx.tsx @@ -7,6 +7,9 @@ export function S({ $?: string, _?: string, } & React.ComponentProps) { - const cls = [className, ...(modifier.match(/\.(\w+)/g) ?? [])].map(s => s.slice(1)).join(' '); + const cls = [ + ...(className ? [className] : []), + ...(modifier.match(/\.(\w+)/g) ?? []), + ].map(s => s.slice(1)).join(' '); return {children}; }