Fix #3860: Don't download images when builders not supported images

This commit is contained in:
Takeshi KOMIYA
2017-06-25 18:11:28 +09:00
parent e0a1fede6d
commit 8f8f0fb868
2 changed files with 7 additions and 2 deletions

View File

@@ -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
--------

View File

@@ -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']
@@ -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']