This commit is contained in:
Li Xin 2025-05-08 12:21:21 +08:00
parent 5c7414ec50
commit 21c21219f1

View File

@ -29,6 +29,19 @@ export default function RootLayout({
}: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en" className={`${geist.variable}`} suppressHydrationWarning>
<head>
{/* Define isSpace function globally to fix markdown-it issues with Next.js + Turbopack
https://github.com/markdown-it/markdown-it/issues/1082#issuecomment-2749656365 */}
<Script id="markdown-it-fix" strategy="beforeInteractive">
{`
if (typeof window !== 'undefined' && typeof window.isSpace === 'undefined') {
window.isSpace = function(code) {
return code === 0x20 || code === 0x09 || code === 0x0A || code === 0x0B || code === 0x0C || code === 0x0D;
};
}
`}
</Script>
</head>
<body className="bg-app">
<ThemeProviderWrapper>{children}</ThemeProviderWrapper>
<Toaster />