update how alt text is handled for ease of use with new form

This commit is contained in:
2026-01-06 17:57:56 -08:00
parent 114d0b3ce5
commit ca34fecec4
3 changed files with 15 additions and 2 deletions

View File

@ -4,7 +4,14 @@ const makeArtistImg = function(artistImg) {
let img = document.createElement("img");
img.src = artistImg.src;
img.alt = artistImg.alt;
if (typeof artistImg.alt === "string") img.alt = artistImg.alt;
else {
let fullAlt = `a ${artistImg.alt.length} image collage.`
for (let i = 0; i < artistImg.alt.length; i++)
fullAlt += ` ${i}: ${artistImg.alt[i]}`
img.alt = fullAlt;
}
imgDiv.append(img);
return imgDiv;