mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2466: Allow image.data_uri and image.nonlocal_uri as confval of suppress_warnings
This commit is contained in:
10
CHANGES
10
CHANGES
@@ -4,7 +4,15 @@ Release 1.4.2 (in development)
|
||||
Features added
|
||||
--------------
|
||||
|
||||
* Now :confval:`suppress_warnings` accepts following configurations: ``app.add_node``, ``app.add_directive``, ``app.add_role`` and ``app.add_generic_role`` (ref: #2451)
|
||||
* Now :confval:`suppress_warnings` accepts following configurations (ref: #2451, #2466):
|
||||
|
||||
- ``app.add_node``
|
||||
- ``app.add_directive``
|
||||
- ``app.add_role``
|
||||
- ``app.add_generic_role``
|
||||
- ``image.data_uri``
|
||||
- ``image.nonlocal_uri``
|
||||
|
||||
* LaTeX writer allows page breaks in topic contents; and their horizontal
|
||||
extent now fits in the line width (shadow in margin). Warning-type
|
||||
admonitions allow page breaks (if very long) and their vertical spacing
|
||||
|
||||
@@ -222,6 +222,8 @@ General configuration
|
||||
* app.add_directive
|
||||
* app.add_role
|
||||
* app.add_generic_role
|
||||
* image.data_uri
|
||||
* image.nonlocal_uri
|
||||
* ref.term
|
||||
* ref.ref
|
||||
* ref.numref
|
||||
|
||||
@@ -908,11 +908,13 @@ class BuildEnvironment:
|
||||
node['candidates'] = candidates = {}
|
||||
imguri = node['uri']
|
||||
if imguri.startswith('data:'):
|
||||
self.warn_node('image data URI found. some builders might not support', node)
|
||||
self.warn_node('image data URI found. some builders might not support', node,
|
||||
type='image', subtype='data_uri')
|
||||
candidates['?'] = imguri
|
||||
continue
|
||||
elif imguri.find('://') != -1:
|
||||
self.warn_node('nonlocal image URI found: %s' % imguri, node)
|
||||
self.warn_node('nonlocal image URI found: %s' % imguri, node,
|
||||
type='image', subtype='nonlocal_uri')
|
||||
candidates['?'] = imguri
|
||||
continue
|
||||
rel_imgpath, full_imgpath = self.relfn2path(imguri, docname)
|
||||
|
||||
Reference in New Issue
Block a user