Fix #3058: Using the same 'caption' attribute in multiple 'toctree' directives results in warning / error

This commit is contained in:
Takeshi KOMIYA 2016-10-17 16:17:47 +09:00
parent cb5e09ffe1
commit 4411f677cf
2 changed files with 3 additions and 4 deletions

View File

@ -5,6 +5,8 @@ Bugs fixed
----------
* #2936: Fix doc/Makefile that can't build man because doc/man exists
* #3058: Using the same 'caption' attribute in multiple 'toctree' directives
results in warning / error
Release 1.4.8 (released Oct 1, 2016)
====================================

View File

@ -52,9 +52,6 @@ class TocTree(Directive):
env = self.state.document.settings.env
suffixes = env.config.source_suffix
glob = 'glob' in self.options
caption = self.options.get('caption')
if caption:
self.options.setdefault('name', nodes.fully_normalize_name(caption))
ret = []
# (title, ref) pairs, where ref may be a document, or an external link,
@ -113,7 +110,7 @@ class TocTree(Directive):
# includefiles only entries that are documents
subnode['includefiles'] = includefiles
subnode['maxdepth'] = self.options.get('maxdepth', -1)
subnode['caption'] = caption
subnode['caption'] = self.options.get('caption')
subnode['glob'] = glob
subnode['hidden'] = 'hidden' in self.options
subnode['includehidden'] = 'includehidden' in self.options