Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageConverter: ignore '?' image URIs #10118

Merged
merged 1 commit into from Mar 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions sphinx/transforms/post_transforms/images.py
Expand Up @@ -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()
Expand Down