Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions sphinx/util/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def nested_parse_to_nodes(
Note that this option bypasses Docutils' usual checks on
doctree structure, and misuse of this option can lead to
an incoherent doctree. In Docutils, section nodes should
only be children of ``Structural`` nodes, which includes
``document``, ``section``, and ``sidebar`` nodes.
only be children of ``document`` or ``section`` nodes.
:param keep_title_context:
If this is False (the default), then *content* is parsed as if it were
an independent document, meaning that title decorations (e.g. underlines)
Expand All @@ -49,6 +48,9 @@ def nested_parse_to_nodes(
a completely different context, such as docstrings.
If this is True, then title underlines must match those in
the surrounding document, otherwise the behaviour is undefined.
Warning: Up to Docutils 0.21, sections with an decoration style
matching a level that is higher than the current section level are
silently discarded! Since Docutils 0.22.1, an error is reported.

.. versionadded:: 7.4
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util/test_util_docutils_sphinx_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def make_directive_and_state(
inliner = Inliner()
inliner.init_customizations(document.settings)
state.inliner = inliner
state.parent = None
state.parent = document
state.memo = SimpleNamespace(
document=document,
reporter=document.reporter,
Expand Down
Loading