Skip to content

Commit

Permalink
Fix sphinx-doc#3860: Don't download images when builders not supporte…
Browse files Browse the repository at this point in the history
…d images
  • Loading branch information
tk0miya committed Jun 25, 2017
1 parent e0a1fed commit 8f8f0fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Bugs fixed
* #3873: Failure of deprecation warning mechanism of
``sphinx.util.compat.Directive``
* #3874: Bogus warnings for "citation not referenced" for cross-file citations
* #3860: Don't download images when builders not supported images

Testing
--------
Expand Down
8 changes: 6 additions & 2 deletions sphinx/transforms/post_transforms/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class ImageDownloader(BaseImageConverter):

def match(self, node):
# type: (nodes.Node) -> bool
if self.app.builder.supported_remote_images:
if self.app.builder.supported_image_types == []:
return False
elif self.app.builder.supported_remote_images:
return False
else:
return '://' in node['uri']
Expand Down Expand Up @@ -108,7 +110,9 @@ class DataURIExtractor(BaseImageConverter):

def match(self, node):
# type: (nodes.Node) -> bool
if self.app.builder.supported_data_uri_images:
if self.app.builder.supported_remote_images == []:
return False
elif self.app.builder.supported_data_uri_images is True:
return False
else:
return 'data:' in node['uri']
Expand Down

0 comments on commit 8f8f0fb

Please sign in to comment.