ImageConverter: ignore '?' image URIs

This commit is contained in:
Matthias Geier 2022-01-18 21:28:06 +01:00
parent 2be0630951
commit 6f221be933

View File

@ -197,12 +197,11 @@ class ImageConverter(BaseImageConverter):
def match(self, node: nodes.image) -> bool: def match(self, node: nodes.image) -> bool:
if not self.app.builder.supported_image_types: if not self.app.builder.supported_image_types:
return False return False
elif '?' in node['candidates']:
return False
elif set(self.guess_mimetypes(node)) & set(self.app.builder.supported_image_types): elif set(self.guess_mimetypes(node)) & set(self.app.builder.supported_image_types):
# builder supports the image; no need to convert # builder supports the image; no need to convert
return False return False
elif node['uri'].startswith('data:'):
# all data URI MIME types are assumed to be supported
return False
elif self.available is None: elif self.available is None:
# store the value to the class variable to share it during the build # store the value to the class variable to share it during the build
self.__class__.available = self.is_available() self.__class__.available = self.is_available()