fix: gallery skip empty text elements

This commit is contained in:
Kieran 2023-10-10 12:40:18 +01:00
parent 50bfd9eaa0
commit 2c31a37b6a
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -184,6 +184,8 @@ export default function Text({
if (nextElement && nextElement.type === "media" && nextElement.mimeType?.startsWith("image")) { if (nextElement && nextElement.type === "media" && nextElement.mimeType?.startsWith("image")) {
galleryImages.push(nextElement); galleryImages.push(nextElement);
i++; i++;
} else if (nextElement && nextElement.type === "text" && nextElement.content.trim().length === 0) {
i++; //skip over empty space text
} else { } else {
break; break;
} }