chore(deps): update dependecies

This commit is contained in:
xfy
2024-09-09 13:29:07 +08:00
parent 9308c9e7be
commit 1a1fb8e72d
4 changed files with 231 additions and 671 deletions

View File

@ -1,7 +1,8 @@
import '@catppuccin/highlightjs/sass/catppuccin.variables.scss';
import clsx from 'clsx';
import CopyCode from 'components/post/copy-code';
import { createElement, Fragment, memo } from 'react';
import { memo } from 'react';
import * as prod from 'react/jsx-runtime';
import rehypeHighlight from 'rehype-highlight';
import rehypeReact from 'rehype-react';
import remarkGfm from 'remark-gfm';
@ -16,6 +17,8 @@ interface Props {
showFileName?: boolean;
}
const production = { Fragment: prod.Fragment, jsx: prod.jsx, jsxs: prod.jsxs };
/**
* Render GitHub gists code.
*
@ -31,10 +34,8 @@ const GistsCode = ({ file, showFileName = false }: Props) => {
.use(remarkRehype)
.use(remarkGfm)
.use(rehypeHighlight)
.use(rehypeReact, {
createElement,
Fragment,
})
// @ts-expect-error: the react types are missing.
.use(rehypeReact, production)
.processSync(`\`\`\`${file.language ?? ''}\n${fileContent}`).result;
return (