Fix #2466: Allow image.data_uri and image.nonlocal_uri as confval of suppress_warnings

This commit is contained in:
Takeshi KOMIYA
2016-04-22 11:14:46 +09:00
parent 88322af1ea
commit 52c7867d14
3 changed files with 15 additions and 3 deletions

10
CHANGES
View File

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

View File

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

View File

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