From 6f221be93398cb5669e44c0fa246d0baa219412e Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 18 Jan 2022 21:28:06 +0100 Subject: [PATCH] ImageConverter: ignore '?' image URIs --- sphinx/transforms/post_transforms/images.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sphinx/transforms/post_transforms/images.py b/sphinx/transforms/post_transforms/images.py index 1a6d4f6d5c..6268604980 100644 --- a/sphinx/transforms/post_transforms/images.py +++ b/sphinx/transforms/post_transforms/images.py @@ -197,12 +197,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: def match(self, node: nodes.image) -> bool: if not self.app.builder.supported_image_types: return False + elif '?' in node['candidates']: + return False elif set(self.guess_mimetypes(node)) & set(self.app.builder.supported_image_types): # builder supports the image; no need to convert return False - elif node['uri'].startswith('data:'): - # all data URI MIME types are assumed to be supported - return False elif self.available is None: # store the value to the class variable to share it during the build self.__class__.available = self.is_available()