mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3860: Don't download images when builders not supported images
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -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
|
||||
--------
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user