mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1358: Fix handling of image paths outside of the source directory when using the "wildcard" style reference.
This commit is contained in:
parent
216c664187
commit
4ab5d6eb52
2
CHANGES
2
CHANGES
@ -10,6 +10,8 @@ Bugs fixed
|
|||||||
* PR#213: Fix a missing import in the setup command.
|
* PR#213: Fix a missing import in the setup command.
|
||||||
* #1357: Option names documented by :rst:dir:`option` are now again allowed to
|
* #1357: Option names documented by :rst:dir:`option` are now again allowed to
|
||||||
not start with a dash or slash, and referencing them will work correctly.
|
not start with a dash or slash, and referencing them will work correctly.
|
||||||
|
* #1358: Fix handling of image paths outside of the source directory when using
|
||||||
|
the "wildcard" style reference.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
@ -799,7 +799,8 @@ class BuildEnvironment:
|
|||||||
node['uri'] = rel_imgpath
|
node['uri'] = rel_imgpath
|
||||||
if rel_imgpath.endswith(os.extsep + '*'):
|
if rel_imgpath.endswith(os.extsep + '*'):
|
||||||
for filename in glob(full_imgpath):
|
for filename in glob(full_imgpath):
|
||||||
new_imgpath = relative_path(self.srcdir, filename)
|
new_imgpath = relative_path(path.join(self.srcdir, 'dummy'),
|
||||||
|
filename)
|
||||||
if filename.lower().endswith('.pdf'):
|
if filename.lower().endswith('.pdf'):
|
||||||
candidates['application/pdf'] = new_imgpath
|
candidates['application/pdf'] = new_imgpath
|
||||||
elif filename.lower().endswith('.svg'):
|
elif filename.lower().endswith('.svg'):
|
||||||
|
@ -163,7 +163,8 @@ class Locale(Transform):
|
|||||||
settings, source = self.document.settings, self.document['source']
|
settings, source = self.document.settings, self.document['source']
|
||||||
# XXX check if this is reliable
|
# XXX check if this is reliable
|
||||||
assert source.startswith(env.srcdir)
|
assert source.startswith(env.srcdir)
|
||||||
docname = path.splitext(relative_path(env.srcdir, source))[0]
|
docname = path.splitext(relative_path(path.join(env.srcdir, 'dummy'),
|
||||||
|
source))[0]
|
||||||
textdomain = find_catalog(docname,
|
textdomain = find_catalog(docname,
|
||||||
self.document.settings.gettext_compact)
|
self.document.settings.gettext_compact)
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ def copy_static_entry(source, targetdir, builder, context={},
|
|||||||
Handles all possible cases of files, directories and subdirectories.
|
Handles all possible cases of files, directories and subdirectories.
|
||||||
"""
|
"""
|
||||||
if exclude_matchers:
|
if exclude_matchers:
|
||||||
relpath = relative_path(builder.srcdir, source)
|
relpath = relative_path(path.join(builder.srcdir, 'dummy'), source)
|
||||||
for matcher in exclude_matchers:
|
for matcher in exclude_matchers:
|
||||||
if matcher(relpath):
|
if matcher(relpath):
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user