File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { ReactNode } from "react" ;
22import Link from "next/link" ;
33import { cn } from "@/utils/ui" ;
4+ import { ReactMarkdownWrapper } from "@/components/ui/react-markdown-wrapper" ;
45import {
56 getSectionTitle ,
67 groupAndOrderChanges ,
@@ -144,7 +145,7 @@ function ReleaseChangeList({
144145 key = { change . text }
145146 className = "text-base leading-relaxed text-foreground"
146147 >
147- { change . text }
148+ < ReactMarkdownWrapper inline > { change . text } </ ReactMarkdownWrapper >
148149 </ li >
149150 ) ) }
150151 </ ul >
Original file line number Diff line number Diff line change 11import ReactMarkdown from "react-markdown" ;
22import { cn } from "@/utils/ui" ;
33
4- export function ReactMarkdownWrapper ( { children } : { children : string } ) {
4+ export function ReactMarkdownWrapper ( {
5+ children,
6+ inline = false ,
7+ } : {
8+ children : string ;
9+ inline ?: boolean ;
10+ } ) {
511 return (
612 < ReactMarkdown
713 components = { {
@@ -18,6 +24,27 @@ export function ReactMarkdownWrapper({ children }: { children: string }) {
1824 strong : ( { children } ) => (
1925 < strong className = "text-foreground font-semibold" > { children } </ strong >
2026 ) ,
27+ code : ( { className : codeClassName , children, ...props } ) => (
28+ < code
29+ className = { cn (
30+ "rounded border border-destructive/20 bg-destructive/5 px-1.5 py-0.5 font-mono text-[0.85em] text-red-700 dark:text-red-300" ,
31+ codeClassName ,
32+ ) }
33+ { ...props }
34+ >
35+ { children }
36+ </ code >
37+ ) ,
38+ p : ( { className : paragraphClassName , children, ...props } ) =>
39+ inline ? (
40+ < span className = { cn ( "m-0" , paragraphClassName ) } { ...props } >
41+ { children }
42+ </ span >
43+ ) : (
44+ < p className = { cn ( "m-0" , paragraphClassName ) } { ...props } >
45+ { children }
46+ </ p >
47+ ) ,
2148 } }
2249 >
2350 { children }
You can’t perform that action at this time.
0 commit comments