diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2010-08-13 12:17:01 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2010-08-13 12:17:01 +0000 |
| commit | 68711c95bb2f03bc0d863224b1c82871dcf749d6 (patch) | |
| tree | dbf815d454c15d6ed9bdcd23cc96a9a560d4009e /docutils | |
| parent | ba4faf80bd15cd44a9ed6640baca351abe2b8b71 (diff) | |
| download | docutils-68711c95bb2f03bc0d863224b1c82871dcf749d6.tar.gz | |
Fix warning for local toc at non-supported level with use-latex-toc:
Fix [ 3043986 ] AttributeError using :local: with table of content.
Report source-line number.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6385 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/HISTORY.txt | 7 | ||||
| -rw-r--r-- | docutils/docutils/parsers/rst/directives/parts.py | 4 | ||||
| -rw-r--r-- | docutils/docutils/writers/latex2e/__init__.py | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index 7f2b55a80..dc627c65c 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -19,7 +19,12 @@ Changes Since 0.7 * tools/buildhtml.py: - -- Fix ``--local`` switch. + - Fix ``--local`` switch. + +* docutils/writers/latex2e/__init__.py + + - Fix [ 3043986 ] AttributeError using :local: with table of content. + Release 0.7 (2010-07-07) ======================== diff --git a/docutils/docutils/parsers/rst/directives/parts.py b/docutils/docutils/parsers/rst/directives/parts.py index 6ef8c905c..7d40e3bce 100644 --- a/docutils/docutils/parsers/rst/directives/parts.py +++ b/docutils/docutils/parsers/rst/directives/parts.py @@ -63,6 +63,10 @@ class Contents(Directive): title = nodes.title('', language.labels['contents']) topic = nodes.topic(classes=['contents']) topic['classes'] += self.options.get('class', []) + # the latex2e writer needs source and line for a warning: + src, srcline = self.state_machine.get_source_and_line() + topic.source = src + topic.line = srcline - 1 if 'local' in self.options: topic['classes'].append('local') if title: diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index f302e7d6e..82f820870 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -2748,7 +2748,7 @@ class LaTeXTranslator(nodes.NodeVisitor): title = self.encode(node.pop(0).astext()) depth = node.get('depth', 0) if 'local' in node['classes']: - self.minitoc(title, node, depth) + self.minitoc(node, title, depth) self.context.append('') return if depth: |
