Skip to content

Commit

Permalink
Merge pull request #10118 from mgeier/image-converter-ignore-question…
Browse files Browse the repository at this point in the history
…mark

ImageConverter: ignore '?' image URIs
  • Loading branch information
tk0miya committed Mar 23, 2022
2 parents 1e1f8e2 + 6f221be commit 138d71f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sphinx/transforms/post_transforms/images.py
Expand Up @@ -189,12 +189,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()
Expand Down

0 comments on commit 138d71f

Please sign in to comment.