Menu ▾ ▴

Commit [r10226]  Maximize  Restore  History

rST parser: restore backwards compatibility of nested parsing.

* Keep document-wide title style hierarchy in nested parsing.

* Revert to using `document.memo.section_level` (required for nested parsing
into a detached base node with document-wide title styles).

+ simpler logic
+ backwards compatible
- more bookkeeping effort
- mandating a document-wide section title style hierarchy is ill-suited for
inclusion of rST blocks from external sources (e.g. extracted docstrings).
See `sphinx.util.parsing.nested_parse_to_nodes()` for an alternative.

This should restore compatibility with Sphinx's "only" directive broken by [r10204].

milde 2025-09-05

changed /trunk/docutils/HISTORY.rst
changed /trunk/docutils/RELEASE-NOTES.rst
changed /trunk/docutils/docutils/parsers/rst/states.py
changed /trunk/docutils/test/test_parsers/test_rst/test_nested_parsing.py
/trunk/docutils/HISTORY.rst Diff Switch to side-by-side view
Loading...
/trunk/docutils/RELEASE-NOTES.rst Diff Switch to side-by-side view
Loading...
/trunk/docutils/docutils/parsers/rst/states.py Diff Switch to side-by-side view
Loading...
/trunk/docutils/test/test_parsers/test_rst/test_nested_parsing.py Diff Switch to side-by-side view
Loading...