Fix bug #424 Wrong circular inclusion detection.
commit93dc79108625a3af6be11a3eb85e50be59b2c910
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 12 Oct 2021 17:33:24 +0000 (12 17:33 +0000)
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 12 Oct 2021 17:33:24 +0000 (12 17:33 +0000)
tree78eaf011374b16620b4a20471908146590bca4be
parent0515f37ca519ecfde133040425a06b6e4887aea0
Fix bug #424 Wrong circular inclusion detection.

The current heuristic for detection of circular includes
fails with nested parsing. Line numbering differs in nested
state-machines, inclusions don't show up in the parent, if
a view is detached (e.g. for table cell content).

The new heuristic uses a "magic" comment instead of line numbers
to keep a log of recursive inclusions.

Add a test case for a false positive and a case for
too late detection in parsed includes.

Adapt tests to (irrelevant) side effects of the patch.

git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8851 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
docutils/HISTORY.txt
docutils/docutils/parsers/rst/directives/misc.py
docutils/docutils/parsers/rst/states.py
docutils/test/test_parsers/test_rst/test_directives/include10.txt
docutils/test/test_parsers/test_rst/test_directives/test_include.py
docutils/test/test_parsers/test_rst/test_source_line.py