Skip to content

Commit

Permalink
Skip "data:" URIs in ImageConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jan 13, 2022
1 parent 8ba2089 commit a73df1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sphinx/transforms/post_transforms/images.py
Expand Up @@ -200,6 +200,9 @@ def match(self, node: nodes.image) -> bool:
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 a73df1e

Please sign in to comment.