@@ -10,6 +10,7 @@ import { A } from "./components/html/a"
10
10
import { Toggle } from "./components/toggle"
11
11
import { PageTitle } from "./components/page-title"
12
12
import { Code } from "./components/html/code"
13
+ import { Img } from "./components/html/img"
13
14
14
15
const defaultFormatDateFn = ( date : Date ) => date . toString ( )
15
16
const defaultResolveLinkFn = ( nId : string ) => null
@@ -26,6 +27,7 @@ export const Render = ({
26
27
a ?: ( props : React . ComponentPropsWithoutRef < "a" > ) => JSX . Element
27
28
code ?: ( props : React . ComponentPropsWithoutRef < "code" > ) => JSX . Element
28
29
iframe ?: ( props : React . ComponentPropsWithoutRef < "iframe" > ) => JSX . Element
30
+ img ?: ( props : React . ComponentPropsWithoutRef < "img" > ) => JSX . Element
29
31
}
30
32
}
31
33
} ) => {
@@ -36,6 +38,7 @@ export const Render = ({
36
38
a : options ?. htmlComponents ?. a ?? A ,
37
39
code : options ?. htmlComponents ?. code ?? Code ,
38
40
iframe : options ?. htmlComponents ?. iframe ,
41
+ img : options ?. htmlComponents ?. img ?? Img ,
39
42
} ,
40
43
}
41
44
return (
@@ -293,7 +296,11 @@ const Block = ({ block, options }: { block: BlockObjectResponseWithChildren; opt
293
296
// ref: .notion-asset-wrapper
294
297
// note: original breakpoint for max-w: `only screen and (max-width: 730px)`
295
298
< figure className = "my-2 w-full" >
296
- < img src = { imageUrl } alt = { imageHasCaption ? block . image . caption [ 0 ] . plain_text : "image" } className = "rounded" />
299
+ < options . htmlComponents . img
300
+ src = { imageUrl }
301
+ alt = { imageHasCaption ? block . image . caption [ 0 ] . plain_text : "image" }
302
+ className = "rounded"
303
+ />
297
304
{ imageHasCaption ? (
298
305
// ref: .notion-asset-caption
299
306
< figcaption className = "whitespace-pre-wrap break-words py-1.5 ps-0.5 text-sm leading-[1.4] text-[color:var(--fg-color-3)] caret-[color:var(--fg-color)]" >
0 commit comments