Menu

Commit [r10227]  Maximize  Restore  History

Adjustments for nested_parse().

* Ensure valid output and update the "current node", if the base node is
the "current node".

If the base node is the state machine's "current node", we can safely assume
that it is attached to the document and check if sections are valid. We can
also update the "current node" of the parent state machine(s) after parsing.
This prevents invalid or mixed up document trees.

* Make the "current node" the default value for the "node" argument.
(This allows simple use for content included from external sources.)

* Restore `memo.section_level` after nested parsing into a custom node.
The calling code must ensure that section_level and current node stay in sync.

* Update unit tests.

milde 2025-09-05

changed /trunk/docutils/HISTORY.rst
changed /trunk/docutils/docutils/nodes.py
changed /trunk/docutils/docutils/parsers/rst/states.py
changed /trunk/docutils/test/test_nodes.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/docutils/nodes.py 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_nodes.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...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.