File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use client' ;
22
33interface CodeBlockProps {
4- node : any ;
5- inline : boolean ;
6- className : string ;
7- children : any ;
4+ node ?: any ;
5+ className ?: string ;
6+ children ?: any ;
87}
98
109export function CodeBlock ( {
1110 node,
12- inline,
1311 className,
1412 children,
1513 ...props
1614} : CodeBlockProps ) {
17- if ( ! inline ) {
15+ if ( node ?. children [ 0 ] ?. value ?. endsWith ( '\n' ) ) {
1816 return (
1917 < div className = "not-prose flex flex-col" >
2018 < pre
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import Link from 'next/link';
22import React , { memo } from 'react' ;
33import ReactMarkdown , { type Components } from 'react-markdown' ;
44import remarkGfm from 'remark-gfm' ;
5+
56import { CodeBlock } from './code-block' ;
67
78const components : Partial < Components > = {
8- // @ts -expect-error
99 code : CodeBlock ,
1010 pre : ( { children } ) => < > { children } </ > ,
1111 ol : ( { node, children, ...props } ) => {
You can’t perform that action at this time.
0 commit comments