diff --git a/CHANGES b/CHANGES index f8f47421f..e9c8ae8ff 100644 --- a/CHANGES +++ b/CHANGES @@ -63,6 +63,7 @@ Bugs fixed * #6230: Inappropriate node_id has been generated by glossary directive if term is consisted by non-ASCII characters +* #6213: ifconfig: contents after headings are not shown Testing -------- diff --git a/doc/usage/extensions/ifconfig.rst b/doc/usage/extensions/ifconfig.rst index f64ca6c58..2bd9d0e3b 100644 --- a/doc/usage/extensions/ifconfig.rst +++ b/doc/usage/extensions/ifconfig.rst @@ -8,6 +8,11 @@ This extension is quite simple, and features only one directive: +.. warning:: + + This directive is designed to control only content of document. It could + not control sections, labels and so on. + .. rst:directive:: ifconfig Include content of the directive only if the Python expression given as an diff --git a/sphinx/ext/ifconfig.py b/sphinx/ext/ifconfig.py index bad5953d3..1768acf18 100644 --- a/sphinx/ext/ifconfig.py +++ b/sphinx/ext/ifconfig.py @@ -23,6 +23,7 @@ from docutils import nodes import sphinx from sphinx.util.docutils import SphinxDirective +from sphinx.util.nodes import nested_parse_with_titles if False: # For type annotation @@ -48,8 +49,7 @@ class IfConfig(SphinxDirective): node.document = self.state.document self.set_source_info(node) node['expr'] = self.arguments[0] - self.state.nested_parse(self.content, self.content_offset, - node, match_titles=True) + nested_parse_with_titles(self.state, self.content, node) return [node]