From 4f893a1e6739966b50bd81317c0b0fc63d6ffd6c Mon Sep 17 00:00:00 2001 From: goodger Date: Thu, 25 Apr 2002 03:52:08 +0000 Subject: Renamed from *2.py (dup module names OK now); enabled running standalone git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@49 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 262 ++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100755 test/test_transforms/test_contents.py (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py new file mode 100755 index 000000000..05a159796 --- /dev/null +++ b/test/test_transforms/test_contents.py @@ -0,0 +1,262 @@ +#! /usr/bin/env python + +""" +:Author: David Goodger +:Contact: goodger@users.sourceforge.net +:Revision: $Revision$ +:Date: $Date$ +:Copyright: This module has been placed in the public domain. + +Tests for docutils.transforms.components.Contents. +""" + +from __init__ import DocutilsTestSupport +from docutils.transforms.universal import LastReaderPending +from docutils.parsers.rst import Parser + + +def suite(): + parser = Parser() + s = DocutilsTestSupport.TransformTestSuite(parser) + s.generateTests(totest) + return s + +totest = {} + +totest['tables_of_contents'] = ((LastReaderPending,), [ +["""\ +.. contents:: + +Title 1 +======= +Paragraph 1. + +Title 2 +------- +Paragraph 2. + +Title 3 +``````` +Paragraph 3. + +Title 4 +------- +Paragraph 4. +""", +"""\ + + + + Contents + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="title-1"> + Title 1 + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="title-2"> + Title 2 + <bullet_list> + <list_item id="id3"> + <paragraph> + <reference refid="title-3"> + Title 3 + <list_item id="id4"> + <paragraph> + <reference refid="title-4"> + Title 4 + <section id="title-1" name="title 1"> + <title refid="id1"> + Title 1 + <paragraph> + Paragraph 1. + <section id="title-2" name="title 2"> + <title refid="id2"> + Title 2 + <paragraph> + Paragraph 2. + <section id="title-3" name="title 3"> + <title refid="id3"> + Title 3 + <paragraph> + Paragraph 3. + <section id="title-4" name="title 4"> + <title refid="id4"> + Title 4 + <paragraph> + Paragraph 4. +"""], +["""\ +.. contents:: Table of Contents + +Title 1 +======= +Paragraph 1. + +Title 2 +------- +Paragraph 2. +""", +"""\ +<document> + <topic class="contents"> + <title> + Table of Contents + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="title-1"> + Title 1 + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="title-2"> + Title 2 + <section id="title-1" name="title 1"> + <title refid="id1"> + Title 1 + <paragraph> + Paragraph 1. + <section id="title-2" name="title 2"> + <title refid="id2"> + Title 2 + <paragraph> + Paragraph 2. +"""], +["""\ +.. contents:: + :depth: 2 + +Title 1 +======= +Paragraph 1. + +Title 2 +------- +Paragraph 2. + +Title 3 +``````` +Paragraph 3. + +Title 4 +------- +Paragraph 4. +""", +"""\ +<document> + <topic class="contents"> + <title> + Contents + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="title-1"> + Title 1 + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="title-2"> + Title 2 + <list_item id="id3"> + <paragraph> + <reference refid="title-4"> + Title 4 + <section id="title-1" name="title 1"> + <title refid="id1"> + Title 1 + <paragraph> + Paragraph 1. + <section id="title-2" name="title 2"> + <title refid="id2"> + Title 2 + <paragraph> + Paragraph 2. + <section id="title-3" name="title 3"> + <title> + Title 3 + <paragraph> + Paragraph 3. + <section id="title-4" name="title 4"> + <title refid="id3"> + Title 4 + <paragraph> + Paragraph 4. +"""], +["""\ +Title 1 +======= + +.. contents:: + :local: + +Paragraph 1. + +Title 2 +------- +Paragraph 2. + +Title 3 +``````` +Paragraph 3. + +Title 4 +------- +Paragraph 4. +""", +"""\ +<document> + <section id="title-1" name="title 1"> + <title> + Title 1 + <topic class="contents"> + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="title-2"> + Title 2 + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="title-3"> + Title 3 + <list_item id="id3"> + <paragraph> + <reference refid="title-4"> + Title 4 + <paragraph> + Paragraph 1. + <section id="title-2" name="title 2"> + <title refid="id1"> + Title 2 + <paragraph> + Paragraph 2. + <section id="title-3" name="title 3"> + <title refid="id2"> + Title 3 + <paragraph> + Paragraph 3. + <section id="title-4" name="title 4"> + <title refid="id3"> + Title 4 + <paragraph> + Paragraph 4. +"""], +["""\ +.. contents:: + +Degenerate case, no table of contents generated. +""", +"""\ +<document> + <paragraph> + Degenerate case, no table of contents generated. +"""], +]) + + +if __name__ == '__main__': + import unittest + unittest.main(defaultTest='suite') -- cgit v1.2.1 From 34f7a6d1ac6f52cf920a933aba804f54c7be5525 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sun, 5 May 2002 15:49:41 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@91 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 48 ++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 05a159796..a05430b3e 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -7,11 +7,13 @@ :Date: $Date$ :Copyright: This module has been placed in the public domain. -Tests for docutils.transforms.components.Contents. +Tests for `docutils.transforms.parts.Contents` (via +`docutils.transforms.universal.LastReaderPending`). """ from __init__ import DocutilsTestSupport from docutils.transforms.universal import LastReaderPending +from docutils.transforms.references import Substitutions from docutils.parsers.rst import Parser @@ -23,7 +25,7 @@ def suite(): totest = {} -totest['tables_of_contents'] = ((LastReaderPending,), [ +totest['tables_of_contents'] = ((Substitutions, LastReaderPending,), [ ["""\ .. contents:: @@ -126,6 +128,46 @@ Paragraph 2. Paragraph 2. """], ["""\ +.. contents:: There's an image in Title 2 + +Title 1 +======= +Paragraph 1. + +|Title 2| +========= +Paragraph 2. + +.. |Title 2| image:: title2.png +""", +"""\ +<document> + <topic class="contents"> + <title> + There's an image in Title 2 + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="title-1"> + Title 1 + <list_item id="id2"> + <paragraph> + <reference refid="title-2"> + Title 2 + <section id="title-1" name="title 1"> + <title refid="id1"> + Title 1 + <paragraph> + Paragraph 1. + <section id="title-2" name="title 2"> + <title refid="id2"> + <image alt="Title 2" uri="title2.png"> + <paragraph> + Paragraph 2. + <substitution_definition name="title 2"> + <image alt="Title 2" uri="title2.png"> +"""], +["""\ .. contents:: :depth: 2 @@ -190,7 +232,7 @@ Title 1 ======= .. contents:: - :local: + :local: Paragraph 1. -- cgit v1.2.1 From 0b3ab52210c5a244aa2e56dd82e2df832aaece71 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Thu, 11 Jul 2002 01:54:17 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@265 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 36 ++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index a05430b3e..fe066e75d 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -47,7 +47,7 @@ Paragraph 4. """, """\ <document> - <topic class="contents"> + <topic class="contents" id="contents" name="Contents"> <title> Contents <bullet_list> @@ -103,7 +103,7 @@ Paragraph 2. """, """\ <document> - <topic class="contents"> + <topic class="contents" id="table-of-contents" name="Table of Contents"> <title> Table of Contents <bullet_list> @@ -142,7 +142,7 @@ Paragraph 2. """, """\ <document> - <topic class="contents"> + <topic class="contents" id="there-s-an-image-in-title-2" name="There's an image in Title 2"> <title> There's an image in Title 2 <bullet_list> @@ -189,7 +189,7 @@ Paragraph 4. """, """\ <document> - <topic class="contents"> + <topic class="contents" id="contents" name="Contents"> <title> Contents <bullet_list> @@ -253,7 +253,7 @@ Paragraph 4. <section id="title-1" name="title 1"> <title> Title 1 - <topic class="contents"> + <topic class="contents" id="contents" name="Contents"> <bullet_list> <list_item id="id1"> <paragraph> @@ -287,6 +287,32 @@ Paragraph 4. Paragraph 4. """], ["""\ +.. contents:: + :local: + +Test duplicate name "Contents". + +Contents +-------- +Paragraph. +""", +"""\ +<document> + <topic class="contents" id="id2" name="Contents"> + <bullet_list> + <list_item id="id1"> + <paragraph> + <reference refid="contents"> + Contents + <paragraph> + Test duplicate name "Contents". + <section id="contents" name="contents"> + <title refid="id1"> + Contents + <paragraph> + Paragraph. +"""], +["""\ .. contents:: Degenerate case, no table of contents generated. -- cgit v1.2.1 From 455515ae2a1e31dbcdf3867cbfa396b9bffa168d Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sun, 14 Jul 2002 03:24:36 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@290 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index fe066e75d..4ac93ef68 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -47,7 +47,7 @@ Paragraph 4. """, """\ <document> - <topic class="contents" id="contents" name="Contents"> + <topic class="contents" id="contents" name="contents"> <title> Contents <bullet_list> @@ -103,7 +103,7 @@ Paragraph 2. """, """\ <document> - <topic class="contents" id="table-of-contents" name="Table of Contents"> + <topic class="contents" id="table-of-contents" name="table of contents"> <title> Table of Contents <bullet_list> @@ -142,7 +142,7 @@ Paragraph 2. """, """\ <document> - <topic class="contents" id="there-s-an-image-in-title-2" name="There's an image in Title 2"> + <topic class="contents" id="there-s-an-image-in-title-2" name="there's an image in title 2"> <title> There's an image in Title 2 <bullet_list> @@ -166,7 +166,7 @@ Paragraph 2. Paragraph 2. <substitution_definition name="title 2"> <image alt="Title 2" uri="title2.png"> -"""], +"""], # emacs cruft: " ["""\ .. contents:: :depth: 2 @@ -189,7 +189,7 @@ Paragraph 4. """, """\ <document> - <topic class="contents" id="contents" name="Contents"> + <topic class="contents" id="contents" name="contents"> <title> Contents <bullet_list> @@ -253,7 +253,7 @@ Paragraph 4. <section id="title-1" name="title 1"> <title> Title 1 - <topic class="contents" id="contents" name="Contents"> + <topic class="contents" id="contents" name="contents"> <bullet_list> <list_item id="id1"> <paragraph> @@ -298,7 +298,7 @@ Paragraph. """, """\ <document> - <topic class="contents" id="id2" name="Contents"> + <topic class="contents" id="id2"> <bullet_list> <list_item id="id1"> <paragraph> -- cgit v1.2.1 From 18fba0d32c5d883296ddb64ee8ad6dc9fa1ddcd2 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Wed, 24 Jul 2002 01:51:41 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@364 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 52 +++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 4ac93ef68..5b416a82d 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -298,14 +298,38 @@ Paragraph. """, """\ <document> - <topic class="contents" id="id2"> + <topic class="contents" id="id1"> <bullet_list> - <list_item id="id1"> + <list_item id="id2"> <paragraph> <reference refid="contents"> Contents <paragraph> Test duplicate name "Contents". + <section id="contents" name="contents"> + <title refid="id2"> + Contents + <paragraph> + Paragraph. +"""], +["""\ +.. contents:: + :backlinks: top + +Contents +-------- +Paragraph. +""", +"""\ +<document> + <topic class="contents" id="id1"> + <title> + Contents + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="contents"> + Contents <section id="contents" name="contents"> <title refid="id1"> Contents @@ -313,6 +337,30 @@ Paragraph. Paragraph. """], ["""\ +.. contents:: + :backlinks: none + +Contents +-------- +Paragraph. +""", +"""\ +<document> + <topic class="contents" id="id1"> + <title> + Contents + <bullet_list> + <list_item id="id2"> + <paragraph> + <reference refid="contents"> + Contents + <section id="contents" name="contents"> + <title> + Contents + <paragraph> + Paragraph. +"""], +["""\ .. contents:: Degenerate case, no table of contents generated. -- cgit v1.2.1 From 1981123ec5a63f9d98ee3b8d8433e7d1cab3b021 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Wed, 7 Aug 2002 01:25:26 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@474 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 68 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 5b416a82d..9b6b70106 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -51,23 +51,23 @@ Paragraph 4. <title> Contents <bullet_list> - <list_item id="id1"> + <list_item> <paragraph> - <reference refid="title-1"> + <reference id="id1" refid="title-1"> Title 1 <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="title-2"> + <reference id="id2" refid="title-2"> Title 2 <bullet_list> - <list_item id="id3"> + <list_item> <paragraph> - <reference refid="title-3"> + <reference id="id3" refid="title-3"> Title 3 - <list_item id="id4"> + <list_item> <paragraph> - <reference refid="title-4"> + <reference id="id4" refid="title-4"> Title 4 <section id="title-1" name="title 1"> <title refid="id1"> @@ -107,14 +107,14 @@ Paragraph 2. <title> Table of Contents <bullet_list> - <list_item id="id1"> + <list_item> <paragraph> - <reference refid="title-1"> + <reference id="id1" refid="title-1"> Title 1 <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="title-2"> + <reference id="id2" refid="title-2"> Title 2 <section id="title-1" name="title 1"> <title refid="id1"> @@ -146,13 +146,13 @@ Paragraph 2. <title> There's an image in Title 2 <bullet_list> - <list_item id="id1"> + <list_item> <paragraph> - <reference refid="title-1"> + <reference id="id1" refid="title-1"> Title 1 - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="title-2"> + <reference id="id2" refid="title-2"> Title 2 <section id="title-1" name="title 1"> <title refid="id1"> @@ -193,18 +193,18 @@ Paragraph 4. <title> Contents <bullet_list> - <list_item id="id1"> + <list_item> <paragraph> - <reference refid="title-1"> + <reference id="id1" refid="title-1"> Title 1 <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="title-2"> + <reference id="id2" refid="title-2"> Title 2 - <list_item id="id3"> + <list_item> <paragraph> - <reference refid="title-4"> + <reference id="id3" refid="title-4"> Title 4 <section id="title-1" name="title 1"> <title refid="id1"> @@ -255,18 +255,18 @@ Paragraph 4. Title 1 <topic class="contents" id="contents" name="contents"> <bullet_list> - <list_item id="id1"> + <list_item> <paragraph> - <reference refid="title-2"> + <reference id="id1" refid="title-2"> Title 2 <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="title-3"> + <reference id="id2" refid="title-3"> Title 3 - <list_item id="id3"> + <list_item> <paragraph> - <reference refid="title-4"> + <reference id="id3" refid="title-4"> Title 4 <paragraph> Paragraph 1. @@ -300,9 +300,9 @@ Paragraph. <document> <topic class="contents" id="id1"> <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="contents"> + <reference id="id2" refid="contents"> Contents <paragraph> Test duplicate name "Contents". @@ -326,9 +326,9 @@ Paragraph. <title> Contents <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="contents"> + <reference id="id2" refid="contents"> Contents <section id="contents" name="contents"> <title refid="id1"> @@ -350,9 +350,9 @@ Paragraph. <title> Contents <bullet_list> - <list_item id="id2"> + <list_item> <paragraph> - <reference refid="contents"> + <reference id="id2" refid="contents"> Contents <section id="contents" name="contents"> <title> -- cgit v1.2.1 From 07dc5b490583921a0cc62654ed4a0e37c1bea9d9 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Tue, 13 Aug 2002 01:06:07 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@514 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 9b6b70106..94f1a8c4b 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -12,7 +12,7 @@ Tests for `docutils.transforms.parts.Contents` (via """ from __init__ import DocutilsTestSupport -from docutils.transforms.universal import LastReaderPending +from docutils.transforms.universal import LastReaderPending, FirstWriterPending from docutils.transforms.references import Substitutions from docutils.parsers.rst import Parser @@ -25,7 +25,7 @@ def suite(): totest = {} -totest['tables_of_contents'] = ((Substitutions, LastReaderPending,), [ +totest['tables_of_contents'] = ((Substitutions, FirstWriterPending), [ ["""\ .. contents:: -- cgit v1.2.1 From 13ed20d392cc6c5e727344dad0c3aca8cea125f1 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Wed, 21 Aug 2002 03:00:07 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@572 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 94f1a8c4b..52ac1e079 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -46,7 +46,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <topic class="contents" id="contents" name="contents"> <title> Contents @@ -102,7 +102,7 @@ Title 2 Paragraph 2. """, """\ -<document> +<document source="test data"> <topic class="contents" id="table-of-contents" name="table of contents"> <title> Table of Contents @@ -141,7 +141,7 @@ Paragraph 2. .. |Title 2| image:: title2.png """, """\ -<document> +<document source="test data"> <topic class="contents" id="there-s-an-image-in-title-2" name="there's an image in title 2"> <title> There's an image in Title 2 @@ -188,7 +188,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <topic class="contents" id="contents" name="contents"> <title> Contents @@ -249,7 +249,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <section id="title-1" name="title 1"> <title> Title 1 @@ -297,7 +297,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <bullet_list> <list_item> @@ -321,7 +321,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <title> Contents @@ -345,7 +345,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <title> Contents @@ -366,7 +366,7 @@ Paragraph. Degenerate case, no table of contents generated. """, """\ -<document> +<document source="test data"> <paragraph> Degenerate case, no table of contents generated. """], -- cgit v1.2.1 From 58036bb54a184a823272be8ddf5f52c619d4f83c Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Tue, 8 Oct 2002 01:35:57 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@774 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 52ac1e079..8618f4a20 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -1,12 +1,12 @@ #! /usr/bin/env python -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. +# Author: David Goodger +# Contact: goodger@users.sourceforge.net +# Revision: $Revision$ +# Date: $Date$ +# Copyright: This module has been placed in the public domain. +""" Tests for `docutils.transforms.parts.Contents` (via `docutils.transforms.universal.LastReaderPending`). """ -- cgit v1.2.1 From a714d9a65946eaec2c775e27e24159ce65ce10a1 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Thu, 24 Oct 2002 01:01:53 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@856 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 8618f4a20..024d5ee4c 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -12,7 +12,6 @@ Tests for `docutils.transforms.parts.Contents` (via """ from __init__ import DocutilsTestSupport -from docutils.transforms.universal import LastReaderPending, FirstWriterPending from docutils.transforms.references import Substitutions from docutils.parsers.rst import Parser @@ -25,7 +24,7 @@ def suite(): totest = {} -totest['tables_of_contents'] = ((Substitutions, FirstWriterPending), [ +totest['tables_of_contents'] = ((Substitutions,), [ ["""\ .. contents:: -- cgit v1.2.1 From 1c87d959eb6be73667ca61bbb48d69b075a846df Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Thu, 27 Mar 2003 03:56:37 +0000 Subject: substitutions made case-sensitive but forgiving (case-insensitive fallback) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@1236 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 024d5ee4c..5f54e7a74 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -163,7 +163,7 @@ Paragraph 2. <image alt="Title 2" uri="title2.png"> <paragraph> Paragraph 2. - <substitution_definition name="title 2"> + <substitution_definition name="Title 2"> <image alt="Title 2" uri="title2.png"> """], # emacs cruft: " ["""\ -- cgit v1.2.1 From 2c868af6838d363ed0ca7fc5571b515622ecf3e2 Mon Sep 17 00:00:00 2001 From: reggie <reggie@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Mon, 22 Mar 2004 01:12:45 +0000 Subject: updated git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@1857 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 5f54e7a74..6816ba2eb 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -291,23 +291,23 @@ Paragraph 4. Test duplicate name "Contents". -Contents +Section -------- Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="id1"> + <topic class="contents" id="contents" name="contents"> <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="contents"> - Contents + <reference id="id1" refid="section"> + Section <paragraph> Test duplicate name "Contents". - <section id="contents" name="contents"> - <title refid="id2"> - Contents + <section id="section" name="section"> + <title refid="id1"> + Section <paragraph> Paragraph. """], @@ -315,23 +315,23 @@ Paragraph. .. contents:: :backlinks: top -Contents +Section -------- Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="id1"> + <topic class="contents" id="contents" name="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="contents"> - Contents - <section id="contents" name="contents"> - <title refid="id1"> - Contents + <reference id="id1" refid="section"> + Section + <section id="section" name="section"> + <title refid="contents"> + Section <paragraph> Paragraph. """], @@ -339,23 +339,23 @@ Paragraph. .. contents:: :backlinks: none -Contents +Section -------- Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="id1"> + <topic class="contents" id="contents" name="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="contents"> - Contents - <section id="contents" name="contents"> + <reference id="id1" refid="section"> + Section + <section id="section" name="section"> <title> - Contents + Section <paragraph> Paragraph. """], -- cgit v1.2.1 From 6e46cba1abe3f4a769591fe971b99a51d6ff3005 Mon Sep 17 00:00:00 2001 From: wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sat, 5 Mar 2005 17:11:05 +0000 Subject: reverted test_nodes.py from 1.14 to 1.13; the nested scopes are necessary because of the lambda expression in line 146:: self.assertEquals(getlist(e, cond=lambda x: x not in e[0:2]), [e[0][0], e[0][1], e[0][1][0], e[2]]) otherwise it doesn't work with Python 2.1 because we can't reference the local e variable. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3010 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 6816ba2eb..3fbc04a9d 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -32,12 +32,12 @@ Title 1 ======= Paragraph 1. -Title 2 -------- +Title_ 2 +-------- Paragraph 2. -Title 3 -``````` +_`Title` 3 +`````````` Paragraph 3. Title 4 -- cgit v1.2.1 From 739ff84633cb5661e211b501c944d0e470c20910 Mon Sep 17 00:00:00 2001 From: wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sat, 5 Mar 2005 17:12:08 +0000 Subject: reverted accidentally committed file git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3011 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 3fbc04a9d..6816ba2eb 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -32,12 +32,12 @@ Title 1 ======= Paragraph 1. -Title_ 2 --------- +Title 2 +------- Paragraph 2. -_`Title` 3 -`````````` +Title 3 +``````` Paragraph 3. Title 4 -- cgit v1.2.1 From 95bd4c152312d1b9a71ef107b8e3d8146b54b90d Mon Sep 17 00:00:00 2001 From: wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sat, 5 Mar 2005 17:48:11 +0000 Subject: do not add a TOC-backlink if title contains a reference git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3014 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 6816ba2eb..4c9d515a8 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -32,12 +32,12 @@ Title 1 ======= Paragraph 1. -Title 2 -------- +Title_ 2 +-------- Paragraph 2. -Title 3 -``````` +_`Title` 3 +`````````` Paragraph 3. Title 4 @@ -58,12 +58,14 @@ Paragraph 4. <list_item> <paragraph> <reference id="id2" refid="title-2"> - Title 2 + Title + 2 <bullet_list> <list_item> <paragraph> <reference id="id3" refid="title-3"> - Title 3 + Title + 3 <list_item> <paragraph> <reference id="id4" refid="title-4"> @@ -74,13 +76,17 @@ Paragraph 4. <paragraph> Paragraph 1. <section id="title-2" name="title 2"> - <title refid="id2"> - Title 2 + <title> + <reference name="Title" refname="title"> + Title + 2 <paragraph> Paragraph 2. <section id="title-3" name="title 3"> <title refid="id3"> - Title 3 + <target id="title" name="title"> + Title + 3 <paragraph> Paragraph 3. <section id="title-4" name="title 4"> -- cgit v1.2.1 From 9dbc2adead008935245a396eab10bb7bcb11b226 Mon Sep 17 00:00:00 2001 From: wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sat, 26 Mar 2005 16:21:28 +0000 Subject: merged rev. 3094:3101 and 3102:HEAD from branches/multiple-ids to trunk git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3129 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 92 +++++++++++++++++------------------ 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 4c9d515a8..95cc098a6 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -46,50 +46,50 @@ Paragraph 4. """, """\ <document source="test data"> - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="title-1"> + <reference ids="id1" refid="title-1"> Title 1 <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="title-2"> + <reference ids="id2" refid="title-2"> Title 2 <bullet_list> <list_item> <paragraph> - <reference id="id3" refid="title-3"> + <reference ids="id3" refid="title-3"> Title 3 <list_item> <paragraph> - <reference id="id4" refid="title-4"> + <reference ids="id4" refid="title-4"> Title 4 - <section id="title-1" name="title 1"> + <section ids="title-1" names="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section id="title-2" name="title 2"> + <section ids="title-2" names="title 2"> <title> <reference name="Title" refname="title"> Title 2 <paragraph> Paragraph 2. - <section id="title-3" name="title 3"> + <section ids="title-3" names="title 3"> <title refid="id3"> - <target id="title" name="title"> + <target ids="title" names="title"> Title 3 <paragraph> Paragraph 3. - <section id="title-4" name="title 4"> + <section ids="title-4" names="title 4"> <title refid="id4"> Title 4 <paragraph> @@ -108,25 +108,25 @@ Paragraph 2. """, """\ <document source="test data"> - <topic class="contents" id="table-of-contents" name="table of contents"> + <topic classes="contents" ids="table-of-contents" names="table of contents"> <title> Table of Contents <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="title-1"> + <reference ids="id1" refid="title-1"> Title 1 <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="title-2"> + <reference ids="id2" refid="title-2"> Title 2 - <section id="title-1" name="title 1"> + <section ids="title-1" names="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section id="title-2" name="title 2"> + <section ids="title-2" names="title 2"> <title refid="id2"> Title 2 <paragraph> @@ -147,29 +147,29 @@ Paragraph 2. """, """\ <document source="test data"> - <topic class="contents" id="there-s-an-image-in-title-2" name="there's an image in title 2"> + <topic classes="contents" ids="there-s-an-image-in-title-2" names="there's an image in title 2"> <title> There's an image in Title 2 <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="title-1"> + <reference ids="id1" refid="title-1"> Title 1 <list_item> <paragraph> - <reference id="id2" refid="title-2"> + <reference ids="id2" refid="title-2"> Title 2 - <section id="title-1" name="title 1"> + <section ids="title-1" names="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section id="title-2" name="title 2"> + <section ids="title-2" names="title 2"> <title refid="id2"> <image alt="Title 2" uri="title2.png"> <paragraph> Paragraph 2. - <substitution_definition name="Title 2"> + <substitution_definition names="Title 2"> <image alt="Title 2" uri="title2.png"> """], # emacs cruft: " ["""\ @@ -194,39 +194,39 @@ Paragraph 4. """, """\ <document source="test data"> - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="title-1"> + <reference ids="id1" refid="title-1"> Title 1 <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="title-2"> + <reference ids="id2" refid="title-2"> Title 2 <list_item> <paragraph> - <reference id="id3" refid="title-4"> + <reference ids="id3" refid="title-4"> Title 4 - <section id="title-1" name="title 1"> + <section ids="title-1" names="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section id="title-2" name="title 2"> + <section ids="title-2" names="title 2"> <title refid="id2"> Title 2 <paragraph> Paragraph 2. - <section id="title-3" name="title 3"> + <section ids="title-3" names="title 3"> <title> Title 3 <paragraph> Paragraph 3. - <section id="title-4" name="title 4"> + <section ids="title-4" names="title 4"> <title refid="id3"> Title 4 <paragraph> @@ -255,37 +255,37 @@ Paragraph 4. """, """\ <document source="test data"> - <section id="title-1" name="title 1"> + <section ids="title-1" names="title 1"> <title> Title 1 - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="title-2"> + <reference ids="id1" refid="title-2"> Title 2 <bullet_list> <list_item> <paragraph> - <reference id="id2" refid="title-3"> + <reference ids="id2" refid="title-3"> Title 3 <list_item> <paragraph> - <reference id="id3" refid="title-4"> + <reference ids="id3" refid="title-4"> Title 4 <paragraph> Paragraph 1. - <section id="title-2" name="title 2"> + <section ids="title-2" names="title 2"> <title refid="id1"> Title 2 <paragraph> Paragraph 2. - <section id="title-3" name="title 3"> + <section ids="title-3" names="title 3"> <title refid="id2"> Title 3 <paragraph> Paragraph 3. - <section id="title-4" name="title 4"> + <section ids="title-4" names="title 4"> <title refid="id3"> Title 4 <paragraph> @@ -303,15 +303,15 @@ Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="section"> + <reference ids="id1" refid="section"> Section <paragraph> Test duplicate name "Contents". - <section id="section" name="section"> + <section ids="section" names="section"> <title refid="id1"> Section <paragraph> @@ -327,15 +327,15 @@ Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="section"> + <reference ids="id1" refid="section"> Section - <section id="section" name="section"> + <section ids="section" names="section"> <title refid="contents"> Section <paragraph> @@ -351,15 +351,15 @@ Paragraph. """, """\ <document source="test data"> - <topic class="contents" id="contents" name="contents"> + <topic classes="contents" ids="contents" names="contents"> <title> Contents <bullet_list> <list_item> <paragraph> - <reference id="id1" refid="section"> + <reference ids="id1" refid="section"> Section - <section id="section" name="section"> + <section ids="section" names="section"> <title> Section <paragraph> -- cgit v1.2.1 From a65d49465f32f45cc8152ccfdd0ee4d26c398353 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sat, 9 Apr 2005 01:32:29 +0000 Subject: allow topics within sidebars; no topics within body elements git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3199 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 95cc098a6..0871aa8f0 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -375,6 +375,57 @@ Degenerate case, no table of contents generated. <paragraph> Degenerate case, no table of contents generated. """], +["""\ +Title 1 +======= + +Paragraph 1. + +.. sidebar:: Contents + + .. contents:: + :local: + +Title 2 +------- +Paragraph 2. + +Title 3 +``````` +Paragraph 3. +""", +"""\ +<document source="test data"> + <section ids="title-1" names="title 1"> + <title> + Title 1 + <paragraph> + Paragraph 1. + <sidebar> + <title> + Contents + <topic classes="contents" ids="contents" names="contents"> + <bullet_list> + <list_item> + <paragraph> + <reference ids="id1" refid="title-2"> + Title 2 + <bullet_list> + <list_item> + <paragraph> + <reference ids="id2" refid="title-3"> + Title 3 + <section ids="title-2" names="title 2"> + <title refid="id1"> + Title 2 + <paragraph> + Paragraph 2. + <section ids="title-3" names="title 3"> + <title refid="id2"> + Title 3 + <paragraph> + Paragraph 3. +"""], ]) -- cgit v1.2.1 From 9061c56e4edac24c8e7adbe7aa6131578af9f040 Mon Sep 17 00:00:00 2001 From: wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Mon, 6 Jun 2005 01:20:35 +0000 Subject: added "local" class to local TOCs git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3439 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index 0871aa8f0..c96764343 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -258,7 +258,7 @@ Paragraph 4. <section ids="title-1" names="title 1"> <title> Title 1 - <topic classes="contents" ids="contents" names="contents"> + <topic classes="contents local" ids="contents" names="contents"> <bullet_list> <list_item> <paragraph> @@ -303,7 +303,7 @@ Paragraph. """, """\ <document source="test data"> - <topic classes="contents" ids="contents" names="contents"> + <topic classes="contents local" ids="contents" names="contents"> <bullet_list> <list_item> <paragraph> @@ -404,7 +404,7 @@ Paragraph 3. <sidebar> <title> Contents - <topic classes="contents" ids="contents" names="contents"> + <topic classes="contents local" ids="contents" names="contents"> <bullet_list> <list_item> <paragraph> -- cgit v1.2.1 From fa67b65d49e091aec810d2e5e8db5b19fc5be2d5 Mon Sep 17 00:00:00 2001 From: goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> Date: Sun, 2 Oct 2005 01:06:42 +0000 Subject: Added ``serial_escape`` function; escapes string values that are elements of a list, for serialization. Modified Docutils-XML writing (``Element._dom_node``) and pseudo-XML writing (``Element.starttag``) to use ``serial_escape``. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3915 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_transforms/test_contents.py | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'test/test_transforms/test_contents.py') diff --git a/test/test_transforms/test_contents.py b/test/test_transforms/test_contents.py index c96764343..19705b5ba 100755 --- a/test/test_transforms/test_contents.py +++ b/test/test_transforms/test_contents.py @@ -70,26 +70,26 @@ Paragraph 4. <paragraph> <reference ids="id4" refid="title-4"> Title 4 - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title> <reference name="Title" refname="title"> Title 2 <paragraph> Paragraph 2. - <section ids="title-3" names="title 3"> + <section ids="title-3" names="title\ 3"> <title refid="id3"> <target ids="title" names="title"> Title 3 <paragraph> Paragraph 3. - <section ids="title-4" names="title 4"> + <section ids="title-4" names="title\ 4"> <title refid="id4"> Title 4 <paragraph> @@ -108,7 +108,7 @@ Paragraph 2. """, """\ <document source="test data"> - <topic classes="contents" ids="table-of-contents" names="table of contents"> + <topic classes="contents" ids="table-of-contents" names="table\ of\ contents"> <title> Table of Contents <bullet_list> @@ -121,12 +121,12 @@ Paragraph 2. <paragraph> <reference ids="id2" refid="title-2"> Title 2 - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title refid="id2"> Title 2 <paragraph> @@ -147,7 +147,7 @@ Paragraph 2. """, """\ <document source="test data"> - <topic classes="contents" ids="there-s-an-image-in-title-2" names="there's an image in title 2"> + <topic classes="contents" ids="there-s-an-image-in-title-2" names="there's\ an\ image\ in\ title\ 2"> <title> There's an image in Title 2 <bullet_list> @@ -159,17 +159,17 @@ Paragraph 2. <paragraph> <reference ids="id2" refid="title-2"> Title 2 - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title refid="id2"> <image alt="Title 2" uri="title2.png"> <paragraph> Paragraph 2. - <substitution_definition names="Title 2"> + <substitution_definition names="Title\ 2"> <image alt="Title 2" uri="title2.png"> """], # emacs cruft: " ["""\ @@ -211,22 +211,22 @@ Paragraph 4. <paragraph> <reference ids="id3" refid="title-4"> Title 4 - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title refid="id2"> Title 2 <paragraph> Paragraph 2. - <section ids="title-3" names="title 3"> + <section ids="title-3" names="title\ 3"> <title> Title 3 <paragraph> Paragraph 3. - <section ids="title-4" names="title 4"> + <section ids="title-4" names="title\ 4"> <title refid="id3"> Title 4 <paragraph> @@ -255,7 +255,7 @@ Paragraph 4. """, """\ <document source="test data"> - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title> Title 1 <topic classes="contents local" ids="contents" names="contents"> @@ -275,17 +275,17 @@ Paragraph 4. Title 4 <paragraph> Paragraph 1. - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title refid="id1"> Title 2 <paragraph> Paragraph 2. - <section ids="title-3" names="title 3"> + <section ids="title-3" names="title\ 3"> <title refid="id2"> Title 3 <paragraph> Paragraph 3. - <section ids="title-4" names="title 4"> + <section ids="title-4" names="title\ 4"> <title refid="id3"> Title 4 <paragraph> @@ -396,7 +396,7 @@ Paragraph 3. """, """\ <document source="test data"> - <section ids="title-1" names="title 1"> + <section ids="title-1" names="title\ 1"> <title> Title 1 <paragraph> @@ -415,12 +415,12 @@ Paragraph 3. <paragraph> <reference ids="id2" refid="title-3"> Title 3 - <section ids="title-2" names="title 2"> + <section ids="title-2" names="title\ 2"> <title refid="id1"> Title 2 <paragraph> Paragraph 2. - <section ids="title-3" names="title 3"> + <section ids="title-3" names="title\ 3"> <title refid="id2"> Title 3 <paragraph> -- cgit v1.2.1