fix: handle empty images (#28669)

Resolves #28668
This commit is contained in:
Raffael Meyer 2024-12-04 16:16:42 +01:00 committed by GitHub
parent a1296433b0
commit 5c4dc84bad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,6 +238,10 @@ def extract_images_from_html(doc: "Document", content: str, is_private: bool = F
if b"," in content:
content = content.split(b",")[1]
if not content:
# if there is no content, return the original tag
return match.group(0)
try:
content = safe_b64decode(content)
except BinasciiError: