Skip to content

Commit

Permalink
Fix sphinx-doc#2407: building docs crash if document includes large d…
Browse files Browse the repository at this point in the history
…ata image URIs
  • Loading branch information
tk0miya committed Apr 16, 2016
1 parent 21ee53d commit 73166b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Bugs fixed

* #2370: the equations are slightly misaligned in LaTeX writer
* #1817, #2077: suppress pep8 warnings on conf.py generated by sphinx-quickstart
* #2407: building docs crash if document includes large data image URIs


Release 1.4.1 (released Apr 12, 2016)
Expand Down
6 changes: 5 additions & 1 deletion sphinx/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,11 @@ def collect_candidates(imgpath, candidates):
# The special key ? is set for nonlocal URIs.
node['candidates'] = candidates = {}
imguri = node['uri']
if imguri.find('://') != -1:
if imguri.startswith('data:'):
self.warn_node('image data URI found. some builders might not support', node)
candidates['?'] = imguri
continue
elif imguri.find('://') != -1:
self.warn_node('nonlocal image URI found: %s' % imguri, node)
candidates['?'] = imguri
continue
Expand Down

0 comments on commit 73166b2

Please sign in to comment.