2026.02.19
마크다운 테스트
마크다운
테스트1테스트2
// ... (import 부분은 동일) ... export default function PostContainer({ children }: { children: string }) { return ( <div className="prose prose-lg prose-slate dark:prose-invert w-full max-w-202.5 sm:w-auto"> <ReactMarkdown remarkPlugins={[remarkGfm]} rehypePlugins={[rehypeRaw]} components={{ code(props) { // 🌟 해결: ref를 밖으로 빼내서 rest에 포함되지 않게 만듭니다. const { children, className, node, ref, ...rest } = props; const match = /language-(\w+)/.exec(className || ''); return match ? ( <SyntaxHighlighter {...rest} // 이제 ref가 빠진 안전한 props만 전달됩니다. PreTag="div" language={match[1]} style={vscDarkPlus} > {String(children).replace(/\n$/, '')} </SyntaxHighlighter> ) : ( // 인라인 코드일 때는 원래대로 ref를 붙여줍니다. <code ref={ref} {...rest} className={className}> {children} </code> ); } }} > {children} </ReactMarkdown> </div> ); }