Skip to content

Commit 43b40e9

Browse files
authored
fix: parse image alt text for image blocks (#1883)
1 parent 4711c08 commit 43b40e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const parseImageElement = (imageElement: HTMLImageElement) => {
22
const url = imageElement.src || undefined;
33
const previewWidth = imageElement.width || undefined;
4+
const name = imageElement.alt || undefined;
45

5-
return { url, previewWidth };
6+
return { url, previewWidth, name };
67
};

packages/server-util/src/context/__snapshots__/ServerBlockNoteEditor.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ exports[`Test ServerBlockNoteEditor > converts to and from markdown (blocksToMar
217217
"props": {
218218
"backgroundColor": "default",
219219
"caption": "",
220-
"name": "",
220+
"name": "Example",
221221
"showPreview": true,
222222
"textAlignment": "left",
223223
"url": "exampleURL",

0 commit comments

Comments
 (0)