@@ -16,6 +16,7 @@ import {
1616 DaisySuccessIcon ,
1717 DaisyWarningIcon ,
1818} from "@/daisyAlertIcon" ;
19+ import { CSSProperties } from "react" ;
1920
2021export function StyledMarkdown ( props : {
2122 content : string ;
@@ -68,6 +69,19 @@ const baseComponents: Components = {
6869 hr : ( ) => null ,
6970 blockquote : ( { node, className, children, ...props } ) => (
7071 < blockquote
72+ className = { clsx ( "alert" , className , "mx-2 my-2" , "flex" ) }
73+ { ...props }
74+ >
75+ < div
76+ // <p>がmx-2 my-2を設定するので、その分広げて相殺
77+ className = "flex-1 w-full -m-2"
78+ >
79+ { children }
80+ </ div >
81+ </ blockquote >
82+ ) ,
83+ aside : ( { node, className, children, ...props } ) => (
84+ < aside
7185 className = { clsx (
7286 "alert" ,
7387 className ,
@@ -86,9 +100,15 @@ const baseComponents: Components = {
86100 ) : className ?. includes ( "alert-error" ) ? (
87101 < DaisyErrorIcon />
88102 ) : null }
89- { /* <p>がmx-2 my-2を設定するので、その分広げて相殺 */ }
90- < div className = "flex-1 w-full -m-2 self-center" > { children } </ div >
91- </ blockquote >
103+ < div
104+ // <p>がmx-2 my-2を設定するので、その分広げて相殺
105+ className = "flex-1 w-full -m-2 self-center"
106+ // alertネスト対応
107+ style = { { "--alert-color" : "initial" } as CSSProperties }
108+ >
109+ { children }
110+ </ div >
111+ </ aside >
92112 ) ,
93113 pre : ( { children } ) => children ,
94114 code : ( props ) => < AutoCodeBlock interactive = { false } { ...props } /> ,
0 commit comments