Skip to content

Commit

Permalink
Merge pull request #10099 from mgeier/skip-data-uris
Browse files Browse the repository at this point in the history
Skip "data:" URIs in ImageConverter
  • Loading branch information
tk0miya committed Jan 15, 2022
2 parents 8ba2089 + a73df1e commit 54159f6
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 54159f6

Please sign in to comment.