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
|
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
|
* LaTeX writer allows page breaks in topic contents; and their horizontal
|
||||||
extent now fits in the line width (shadow in margin). Warning-type
|
extent now fits in the line width (shadow in margin). Warning-type
|
||||||
admonitions allow page breaks (if very long) and their vertical spacing
|
admonitions allow page breaks (if very long) and their vertical spacing
|
||||||
|
|||||||
@@ -222,6 +222,8 @@ General configuration
|
|||||||
* app.add_directive
|
* app.add_directive
|
||||||
* app.add_role
|
* app.add_role
|
||||||
* app.add_generic_role
|
* app.add_generic_role
|
||||||
|
* image.data_uri
|
||||||
|
* image.nonlocal_uri
|
||||||
* ref.term
|
* ref.term
|
||||||
* ref.ref
|
* ref.ref
|
||||||
* ref.numref
|
* ref.numref
|
||||||
|
|||||||
@@ -908,11 +908,13 @@ class BuildEnvironment:
|
|||||||
node['candidates'] = candidates = {}
|
node['candidates'] = candidates = {}
|
||||||
imguri = node['uri']
|
imguri = node['uri']
|
||||||
if imguri.startswith('data:'):
|
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
|
candidates['?'] = imguri
|
||||||
continue
|
continue
|
||||||
elif imguri.find('://') != -1:
|
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
|
candidates['?'] = imguri
|
||||||
continue
|
continue
|
||||||
rel_imgpath, full_imgpath = self.relfn2path(imguri, docname)
|
rel_imgpath, full_imgpath = self.relfn2path(imguri, docname)
|
||||||
|
|||||||
Reference in New Issue
Block a user