Skip to content

Commit 54159f6

Browse files
authored
Merge pull request #10099 from mgeier/skip-data-uris
Skip "data:" URIs in ImageConverter
2 parents 8ba2089 + a73df1e commit 54159f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sphinx/transforms/post_transforms/images.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ def match(self, node: nodes.image) -> bool:
200200
elif set(self.guess_mimetypes(node)) & set(self.app.builder.supported_image_types):
201201
# builder supports the image; no need to convert
202202
return False
203+
elif node['uri'].startswith('data:'):
204+
# all data URI MIME types are assumed to be supported
205+
return False
203206
elif self.available is None:
204207
# store the value to the class variable to share it during the build
205208
self.__class__.available = self.is_available()

0 commit comments

Comments
 (0)