diff --git a/.gitattributes b/.gitattributes index c8acd10815a..0a185ba6752 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,8 +51,10 @@ tests/roots/test-pycode/cp_1251_coded.py dos # Non UTF-8 encodings tests/roots/test-pycode/cp_1251_coded.py working-tree-encoding=windows-1251 -tests/roots/test-root/wrongenc.inc working-tree-encoding=latin-1 -tests/roots/test-warnings/wrongenc.inc working-tree-encoding=latin-1 +# the real encoding is iso-8859-1 (latin-1), but Git chokes on both names +# cf. https://github.com/sphinx-doc/sphinx/pull/13811#issuecomment-3243213202 +tests/roots/test-root/wrongenc.inc working-tree-encoding=iso-8859 +tests/roots/test-warnings/wrongenc.inc working-tree-encoding=iso-8859 # Generated files # https://github.com/github/linguist/blob/master/docs/overrides.md diff --git a/sphinx/util/parsing.py b/sphinx/util/parsing.py index 4c4a6477683..61c2e07fcf2 100644 --- a/sphinx/util/parsing.py +++ b/sphinx/util/parsing.py @@ -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) @@ -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 """