Menu ▾ ▴

Commit [r10204]  Maximize  Restore  History

rST parser: new title-style hierarchy for nested parsing with detached base node.

Use a separate section title style hierarchy for nested parsing
if the base node is not attached to the document.

With a detached base, the parser can not move up in the section hierarchy, so it
does not make sense to enforce the document-wide title style hierarchy.

Separate title styles also fit better with directives that fetch their content
from separate sources.
Docutils does not switch on section support in nested parsing.
Sphinx defines and uses a "_fresh_title_style_context" in nested parsing.
Some contributed Sphinx extensions reported regeressions with the new
section parsing algorightm because the old algorithm was forgiving in case
of inconsistent title styles in nested parsing (cf. [bugs:#508]).

milde 2025-08-15

changed /trunk/docutils/HISTORY.rst
changed /trunk/docutils/RELEASE-NOTES.rst
changed /trunk/docutils/docs/ref/rst/directives.rst
changed /trunk/docutils/docs/ref/rst/restructuredtext.rst
changed /trunk/docutils/docutils/parsers/rst/states.py
changed /trunk/docutils/test/test_parsers/test_rst/test_misc.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/docs/ref/rst/directives.rst Diff Switch to side-by-side view
Loading...
/trunk/docutils/docs/ref/rst/restructuredtext.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_misc.py Diff Switch to side-by-side view
Loading...