Add alt attribute to imgs

This commit is contained in:
tobias
2024-05-19 08:50:00 +02:00
parent 467b4bb0ad
commit a8362fa88f
4 changed files with 9 additions and 10 deletions

View File

@ -12,12 +12,13 @@ export const getContentArray = (content: any) => {
src: node.value.filename,
width: `${node.value.width}`,
height: `${node.value.height}`,
alt: `${node.value.alt}`,
}),
},
}).replaceAll("<p></p>", "<p>&nbsp;</p>");
const htmlImageArray: (
| string
| { src: string; width: number; height: number }
| { src: string; width: number; height: number, alt: string }
)[] = [];
let lastIndex = 0;
while (true) {