Skip to content

Commit 81887ea

Browse files
Merge pull request #594 from yoo2001818/master
2 parents b027784 + e524e40 commit 81887ea

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/notion-types/src/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export interface BaseContentBlock extends BaseBlock {
131131
properties: {
132132
source: string[][]
133133
caption?: Decoration[]
134+
alt_text?: Decoration[]
134135
}
135136
format?: {
136137
block_alignment: 'center' | 'left' | 'right'

packages/react-notion-x/src/components/asset.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ export function Asset({
280280
source = block.properties?.source?.[0]?.[0]
281281
}
282282
const src = mapImageUrl(source, block as Block)
283+
const altText = getTextContent(block.properties?.alt_text)
283284
const caption = getTextContent(block.properties?.caption)
284-
const alt = caption || 'notion image'
285+
const alt = altText || caption || 'notion image'
285286

286287
content = (
287288
<LazyImage

0 commit comments

Comments
 (0)