fix: fix fucking react-syntax-highlighter

This commit is contained in:
Shinwoo PARK 2025-03-12 13:25:17 +09:00
parent 701a77d234
commit dce7823955
3 changed files with 21 additions and 5 deletions

View File

@ -23,7 +23,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
"react-syntax-highlighter": "^15.5.0",
"react-syntax-highlighter": "^15.6.1",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"tailwind-merge": "^2.3.0",

View File

@ -1,7 +1,16 @@
import { Button } from "@pswui/Button";
import { useToast } from "@pswui/Toast";
import { forwardRef, useEffect, useMemo, useState } from "react";
import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter";
import {
type Component,
forwardRef,
useEffect,
useMemo,
useState,
} from "react";
import {
PrismLight,
type SyntaxHighlighterProps,
} from "react-syntax-highlighter";
import { duotoneSpace } from "react-syntax-highlighter/dist/cjs/styles/prism";
import css from "react-syntax-highlighter/dist/esm/languages/prism/css";
import js from "react-syntax-highlighter/dist/esm/languages/prism/javascript";
@ -11,6 +20,13 @@ import tsx from "react-syntax-highlighter/dist/esm/languages/prism/tsx";
import ts from "react-syntax-highlighter/dist/esm/languages/prism/typescript";
import { twMerge } from "tailwind-merge";
const SyntaxHighlighter =
PrismLight as unknown as typeof Component<SyntaxHighlighterProps> & {
registerLanguage<T>(name: string, func: T): void;
alias(name: string, alias: string | string[]): void;
alias(aliases: Record<string, string | string[]>): void;
};
SyntaxHighlighter.registerLanguage("javascript", js);
SyntaxHighlighter.registerLanguage("typescript", ts);
SyntaxHighlighter.registerLanguage("tsx", tsx);

View File

@ -5484,7 +5484,7 @@ __metadata:
languageName: node
linkType: hard
"react-syntax-highlighter@npm:^15.5.0":
"react-syntax-highlighter@npm:^15.6.1":
version: 15.6.1
resolution: "react-syntax-highlighter@npm:15.6.1"
dependencies:
@ -6342,7 +6342,7 @@ __metadata:
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
react-router-dom: "npm:^6.23.1"
react-syntax-highlighter: "npm:^15.5.0"
react-syntax-highlighter: "npm:^15.6.1"
rehype-slug: "npm:^6.0.0"
remark-gfm: "npm:^4.0.0"
tailwind-merge: "npm:^2.3.0"