summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authoraa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-10-28 02:58:42 +0000
committeraa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-10-28 02:58:42 +0000
commitab09362e5ba200472145995ee01ee21c76fbbd30 (patch)
tree598966aefba68d81a462546a40b376f0b3a3102b /docutils
parentdce1c00e7333a32f99e19e3fd3a1dd8a99fb8c36 (diff)
downloaddocutils-ab09362e5ba200472145995ee01ee21c76fbbd30.tar.gz
Compare dictionaries directly
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9192 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/test/DocutilsTestSupport.py15
-rwxr-xr-xdocutils/test/test_writers/test_html4css1_parts.py193
-rw-r--r--docutils/test/test_writers/test_html5_polyglot_parts.py266
3 files changed, 208 insertions, 266 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py
index 0920e7ed0..c74c03279 100644
--- a/docutils/test/DocutilsTestSupport.py
+++ b/docutils/test/DocutilsTestSupport.py
@@ -556,10 +556,7 @@ class HtmlWriterPublishPartsTestCase(WriterPublishTestCase):
writer_name=self.writer_name,
settings_spec=self,
settings_overrides=self.suite_settings)
- output = self.format_output(parts)
- # interpolate standard variables:
- expected = self.expected % {'version': docutils.__version__}
- self.assertEqual(output, expected)
+ self.assertEqual(self.format_output(parts), self.expected)
standard_content_type_template = ('<meta http-equiv="Content-Type"'
' content="text/html; charset=%s" />\n')
@@ -594,15 +591,7 @@ class HtmlWriterPublishPartsTestCase(WriterPublishTestCase):
self.standard_html_meta_value, '...')
parts['html_prolog'] = parts['html_prolog'].replace(
self.standard_html_prolog, '')
- output = []
- for key in sorted(parts.keys()):
- if not parts[key]:
- continue
- output.append("%r: '''%s'''"
- % (key, parts[key]))
- if output[-1].endswith("\n'''"):
- output[-1] = output[-1][:-4] + "\\n'''"
- return '{' + ',\n '.join(output) + '}\n'
+ return {k: v for k, v in parts.items() if v}
class HtmlPublishPartsTestSuite(CustomTestSuite):
diff --git a/docutils/test/test_writers/test_html4css1_parts.py b/docutils/test/test_writers/test_html4css1_parts.py
index e56508a56..9a3405991 100755
--- a/docutils/test/test_writers/test_html4css1_parts.py
+++ b/docutils/test/test_writers/test_html4css1_parts.py
@@ -28,84 +28,77 @@ totest['Title promotion'] = ({'stylesheet_path': '',
["""\
Simple String
""",
-"""\
-{'fragment': '''<p>Simple String</p>\\n''',
+{'fragment': '''<p>Simple String</p>\n''',
'html_body': '''<div class="document">
<p>Simple String</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with *markup*
""",
-"""\
-{'fragment': '''<p>Simple String with <em>markup</em></p>\\n''',
+{'fragment': '''<p>Simple String with <em>markup</em></p>\n''',
'html_body': '''<div class="document">
<p>Simple String with <em>markup</em></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with an even simpler ``inline literal``
""",
-"""\
-{'fragment': '''<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>\\n''',
+{'fragment': '''<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>\n''',
'html_body': '''<div class="document">
<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple ``inline\xA0literal`` with NBSP
""",
-"""\
-{'fragment': '''<p>Simple <tt class="docutils literal">inline&nbsp;literal</tt> with NBSP</p>\\n''',
+{'fragment': '''<p>Simple <tt class="docutils literal">inline&nbsp;literal</tt> with NBSP</p>\n''',
'html_body': '''<div class="document">
<p>Simple <tt class="docutils literal">inline&nbsp;literal</tt> with NBSP</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `anonymous reference`__
__ http://www.test.com/test_url
""",
-"""\
-{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\\n''',
+{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\n''',
'html_body': '''<div class="document">
<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
One paragraph.
Two paragraphs.
""",
-"""\
{'fragment': '''<p>One paragraph.</p>
-<p>Two paragraphs.</p>\\n''',
+<p>Two paragraphs.</p>\n''',
'html_body': '''<div class="document">
<p>One paragraph.</p>
<p>Two paragraphs.</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `named reference`_ with stuff in between the
reference and the target.
.. _`named reference`: http://www.test.com/test_url
""",
-"""\
{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
-reference and the target.</p>\\n''',
+reference and the target.</p>\n''',
'html_body': '''<div class="document">
<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
reference and the target.</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
+++++
Title
@@ -126,7 +119,6 @@ Another Section
And even more stuff
""",
-"""\
{'fragment': '''<p>Some stuff</p>
<div class="section" id="section">
<h1>Section</h1>
@@ -135,7 +127,7 @@ And even more stuff
<h2>Another Section</h2>
<p>And even more stuff</p>
</div>
-</div>\\n''',
+</div>\n''',
'html_body': '''<div class="document" id="title">
<h1 class="title">Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>
@@ -148,13 +140,13 @@ And even more stuff
<p>And even more stuff</p>
</div>
</div>
-</div>\\n''',
- 'html_head': '''...<title>Title</title>\\n''',
- 'html_subtitle': '''<h2 class="subtitle" id="subtitle">Subtitle</h2>\\n''',
- 'html_title': '''<h1 class="title">Title</h1>\\n''',
+</div>\n''',
+ 'html_head': '''...<title>Title</title>\n''',
+ 'html_subtitle': '''<h2 class="subtitle" id="subtitle">Subtitle</h2>\n''',
+ 'html_title': '''<h1 class="title">Title</h1>\n''',
'subtitle': '''Subtitle''',
- 'title': '''Title'''}
-"""],
+ 'title': '''Title'''
+}],
["""\
+++++
Title
@@ -164,7 +156,6 @@ Title
Some stuff
""",
-"""\
{'docinfo': '''<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
@@ -172,8 +163,8 @@ Some stuff
<tr><th class="docinfo-name">Author:</th>
<td>me</td></tr>
</tbody>
-</table>\\n''',
- 'fragment': '''<p>Some stuff</p>\\n''',
+</table>\n''',
+ 'fragment': '''<p>Some stuff</p>\n''',
'html_body': '''<div class="document" id="title">
<h1 class="title">Title</h1>
<table class="docinfo" frame="void" rules="none">
@@ -185,13 +176,13 @@ Some stuff
</tbody>
</table>
<p>Some stuff</p>
-</div>\\n''',
+</div>\n''',
'html_head': '''...<title>Title</title>
-<meta name="author" content="me" />\\n''',
- 'html_title': '''<h1 class="title">Title</h1>\\n''',
- 'meta': '''<meta name="author" content="me" />\\n''',
- 'title': '''Title'''}
-"""]
+<meta name="author" content="me" />\n''',
+ 'html_title': '''<h1 class="title">Title</h1>\n''',
+ 'meta': '''<meta name="author" content="me" />\n''',
+ 'title': '''Title'''
+}]
])
totest['No title promotion'] = ({'doctitle_xform': 0,
@@ -200,60 +191,55 @@ totest['No title promotion'] = ({'doctitle_xform': 0,
["""\
Simple String
""",
-"""\
-{'fragment': '''<p>Simple String</p>\\n''',
+{'fragment': '''<p>Simple String</p>\n''',
'html_body': '''<div class="document">
<p>Simple String</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with *markup*
""",
-"""\
-{'fragment': '''<p>Simple String with <em>markup</em></p>\\n''',
+{'fragment': '''<p>Simple String with <em>markup</em></p>\n''',
'html_body': '''<div class="document">
<p>Simple String with <em>markup</em></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with an even simpler ``inline literal``
""",
-"""\
-{'fragment': '''<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>\\n''',
+{'fragment': '''<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>\n''',
'html_body': '''<div class="document">
<p>Simple String with an even simpler <tt class="docutils literal">inline literal</tt></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `anonymous reference`__
__ http://www.test.com/test_url
""",
-"""\
-{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\\n''',
+{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\n''',
'html_body': '''<div class="document">
<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `named reference`_ with stuff in between the
reference and the target.
.. _`named reference`: http://www.test.com/test_url
""",
-"""\
{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
-reference and the target.</p>\\n''',
+reference and the target.</p>\n''',
'html_body': '''<div class="document">
<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
reference and the target.</p>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
+++++
Title
@@ -274,7 +260,6 @@ Another Section
And even more stuff
""",
-"""\
{'fragment': '''<div class="section" id="title">
<h1>Title</h1>
<div class="section" id="not-a-subtitle">
@@ -289,7 +274,7 @@ And even more stuff
</div>
</div>
</div>
-</div>\\n''',
+</div>\n''',
'html_body': '''<div class="document">
<div class="section" id="title">
<h1>Title</h1>
@@ -306,26 +291,25 @@ And even more stuff
</div>
</div>
</div>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
* bullet
* list
""",
-"""\
{'fragment': '''<ul class="simple">
<li>bullet</li>
<li>list</li>
-</ul>\\n''',
+</ul>\n''',
'html_body': '''<div class="document">
<ul class="simple">
<li>bullet</li>
<li>list</li>
</ul>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. table::
:align: right
@@ -336,11 +320,10 @@ And even more stuff
| 3 | 4 |
+-----+-----+
""",
-"""\
{'fragment': '''<table border="1" class="docutils align-right">
<colgroup>
-<col width="50%%" />
-<col width="50%%" />
+<col width="50%" />
+<col width="50%" />
</colgroup>
<tbody valign="top">
<tr><td>1</td>
@@ -350,12 +333,12 @@ And even more stuff
<td>4</td>
</tr>
</tbody>
-</table>\\n''',
+</table>\n''',
'html_body': '''<div class="document">
<table border="1" class="docutils align-right">
<colgroup>
-<col width="50%%" />
-<col width="50%%" />
+<col width="50%" />
+<col width="50%" />
</colgroup>
<tbody valign="top">
<tr><td>1</td>
@@ -366,9 +349,9 @@ And even more stuff
</tr>
</tbody>
</table>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
@@ -379,7 +362,6 @@ Not a docinfo.
:simple:
:field: list
""",
-"""\
{'fragment': '''<p>Not a docinfo.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@@ -395,7 +377,7 @@ Not a docinfo.
<tr class="field"><th class="field-name">field:</th><td class="field-body">list</td>
</tr>
</tbody>
-</table>\\n''',
+</table>\n''',
'html_body': '''<div class="document">
<p>Not a docinfo.</p>
<table class="docutils field-list" frame="void" rules="none">
@@ -413,16 +395,15 @@ Not a docinfo.
</tr>
</tbody>
</table>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
:This is: a
:simple field list with loooong field: names
""",
-"""\
{'fragment': '''<p>Not a docinfo.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@@ -434,7 +415,7 @@ Not a docinfo.
<tr class="field"><td>&nbsp;</td><td class="field-body">names</td>
</tr>
</tbody>
-</table>\\n''',
+</table>\n''',
'html_body': '''<div class="document">
<p>Not a docinfo.</p>
<table class="docutils field-list" frame="void" rules="none">
@@ -448,9 +429,9 @@ Not a docinfo.
</tr>
</tbody>
</table>
-</div>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</div>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
])
diff --git a/docutils/test/test_writers/test_html5_polyglot_parts.py b/docutils/test/test_writers/test_html5_polyglot_parts.py
index 120684b7b..b84074e2d 100644
--- a/docutils/test/test_writers/test_html5_polyglot_parts.py
+++ b/docutils/test/test_writers/test_html5_polyglot_parts.py
@@ -69,82 +69,75 @@ totest['standard'] = ({'stylesheet_path': '',
["""\
Simple String
""",
-"""\
-{'fragment': '''<p>Simple String</p>\\n''',
+{'fragment': '''<p>Simple String</p>\n''',
'html_body': '''<main>
<p>Simple String</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with *markup*
""",
-"""\
-{'fragment': '''<p>Simple String with <em>markup</em></p>\\n''',
+{'fragment': '''<p>Simple String with <em>markup</em></p>\n''',
'html_body': '''<main>
<p>Simple String with <em>markup</em></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with an even simpler ``inline literal``
""",
-"""\
-{'fragment': '''<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>\\n''',
+{'fragment': '''<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>\n''',
'html_body': '''<main>
<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `anonymous reference`__
__ http://www.test.com/test_url
""",
-"""\
-{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\\n''',
+{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\n''',
'html_body': '''<main>
<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
One paragraph.
Two paragraphs.
""",
-"""\
{'fragment': '''<p>One paragraph.</p>
-<p>Two paragraphs.</p>\\n''',
+<p>Two paragraphs.</p>\n''',
'html_body': '''<main>
<p>One paragraph.</p>
<p>Two paragraphs.</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `named reference`_ with stuff in between the
reference and the target.
.. _`named reference`: http://www.test.com/test_url
""",
-"""\
{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
-reference and the target.</p>\\n''',
+reference and the target.</p>\n''',
'html_body': '''<main>
<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
reference and the target.</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
[""".. [CIT2022] A citation.""",
-"""\
{'fragment': '''<div role="list" class="citation-list">
<div class="citation" id="cit2022" role="doc-biblioentry">
<span class="label"><span class="fn-bracket">[</span>CIT2022<span class="fn-bracket">]</span></span>
<p>A citation.</p>
</div>
-</div>\\n''',
+</div>\n''',
'html_body': '''<main>
<div role="list" class="citation-list">
<div class="citation" id="cit2022" role="doc-biblioentry">
@@ -152,9 +145,9 @@ reference and the target.</p>
<p>A citation.</p>
</div>
</div>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
+++++
Title
@@ -175,7 +168,6 @@ Another Section
And even more stuff
""",
-"""\
{'fragment': '''<p>Some stuff</p>
<section id="section">
<h2>Section<a class="self-link" title="link to this section" href="#section"></a></h2>
@@ -184,7 +176,7 @@ And even more stuff
<h3>Another Section<a class="self-link" title="link to this section" href="#another-section"></a></h3>
<p>And even more stuff</p>
</section>
-</section>\\n''',
+</section>\n''',
'html_body': '''<main id="title">
<h1 class="title">Title</h1>
<p class="subtitle" id="subtitle">Subtitle</p>
@@ -197,13 +189,13 @@ And even more stuff
<p>And even more stuff</p>
</section>
</section>
-</main>\\n''',
- 'html_head': '''...<title>Title</title>\\n''',
- 'html_subtitle': '''<p class="subtitle" id="subtitle">Subtitle</p>\\n''',
- 'html_title': '''<h1 class="title">Title</h1>\\n''',
+</main>\n''',
+ 'html_head': '''...<title>Title</title>\n''',
+ 'html_subtitle': '''<p class="subtitle" id="subtitle">Subtitle</p>\n''',
+ 'html_title': '''<h1 class="title">Title</h1>\n''',
'subtitle': '''Subtitle''',
- 'title': '''Title'''}
-"""],
+ 'title': '''Title'''
+}],
["""\
+++++
Title
@@ -213,12 +205,11 @@ Title
Some stuff
""",
-"""\
{'docinfo': '''<dl class="docinfo simple">
<dt class="author">Author<span class="colon">:</span></dt>
<dd class="author"><p>me</p></dd>
-</dl>\\n''',
- 'fragment': '''<p>Some stuff</p>\\n''',
+</dl>\n''',
+ 'fragment': '''<p>Some stuff</p>\n''',
'html_body': '''<main id="title">
<h1 class="title">Title</h1>
<dl class="docinfo simple">
@@ -226,13 +217,13 @@ Some stuff
<dd class="author"><p>me</p></dd>
</dl>
<p>Some stuff</p>
-</main>\\n''',
+</main>\n''',
'html_head': '''...<title>Title</title>
-<meta name="author" content="me" />\\n''',
- 'html_title': '''<h1 class="title">Title</h1>\\n''',
- 'meta': '''<meta name="author" content="me" />\\n''',
- 'title': '''Title'''}
-"""]
+<meta name="author" content="me" />\n''',
+ 'html_title': '''<h1 class="title">Title</h1>\n''',
+ 'meta': '''<meta name="author" content="me" />\n''',
+ 'title': '''Title'''
+}]
])
totest['No title promotion'] = ({'doctitle_xform': 0,
@@ -241,60 +232,55 @@ totest['No title promotion'] = ({'doctitle_xform': 0,
["""\
Simple String
""",
-"""\
-{'fragment': '''<p>Simple String</p>\\n''',
+{'fragment': '''<p>Simple String</p>\n''',
'html_body': '''<main>
<p>Simple String</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with *markup*
""",
-"""\
-{'fragment': '''<p>Simple String with <em>markup</em></p>\\n''',
+{'fragment': '''<p>Simple String with <em>markup</em></p>\n''',
'html_body': '''<main>
<p>Simple String with <em>markup</em></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Simple String with an even simpler ``inline literal``
""",
-"""\
-{'fragment': '''<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>\\n''',
+{'fragment': '''<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>\n''',
'html_body': '''<main>
<p>Simple String with an even simpler <span class="docutils literal">inline literal</span></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `anonymous reference`__
__ http://www.test.com/test_url
""",
-"""\
-{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\\n''',
+{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>\n''',
'html_body': '''<main>
<p>A simple <a class="reference external" href="http://www.test.com/test_url">anonymous reference</a></p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
A simple `named reference`_ with stuff in between the
reference and the target.
.. _`named reference`: http://www.test.com/test_url
""",
-"""\
{'fragment': '''<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
-reference and the target.</p>\\n''',
+reference and the target.</p>\n''',
'html_body': '''<main>
<p>A simple <a class="reference external" href="http://www.test.com/test_url">named reference</a> with stuff in between the
reference and the target.</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
+++++
Title
@@ -315,7 +301,6 @@ Another Section
And even more stuff
""",
-"""\
{'fragment': '''<section id="title">
<h2>Title<a class="self-link" title="link to this section" href="#title"></a></h2>
<section id="not-a-subtitle">
@@ -330,7 +315,7 @@ And even more stuff
</section>
</section>
</section>
-</section>\\n''',
+</section>\n''',
'html_body': '''<main>
<section id="title">
<h2>Title<a class="self-link" title="link to this section" href="#title"></a></h2>
@@ -347,26 +332,25 @@ And even more stuff
</section>
</section>
</section>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
* bullet
* list
""",
-"""\
{'fragment': '''<ul class="simple">
<li><p>bullet</p></li>
<li><p>list</p></li>
-</ul>\\n''',
+</ul>\n''',
'html_body': '''<main>
<ul class="simple">
<li><p>bullet</p></li>
<li><p>list</p></li>
</ul>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. table::
:align: right
@@ -377,7 +361,6 @@ And even more stuff
| 3 | 4 |
+-----+-----+
""",
-"""\
{'fragment': '''<table class="align-right">
<tbody>
<tr><td><p>1</p></td>
@@ -387,7 +370,7 @@ And even more stuff
<td><p>4</p></td>
</tr>
</tbody>
-</table>\\n''',
+</table>\n''',
'html_body': '''<main>
<table class="align-right">
<tbody>
@@ -399,9 +382,9 @@ And even more stuff
</tr>
</tbody>
</table>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
@@ -412,7 +395,6 @@ Not a docinfo.
:simple:
:field: list
""",
-"""\
{'fragment': '''<p>Not a docinfo.</p>
<dl class="field-list simple">
<dt>This<span class="colon">:</span></dt>
@@ -425,7 +407,7 @@ Not a docinfo.
<dt>field<span class="colon">:</span></dt>
<dd><p>list</p>
</dd>
-</dl>\\n''',
+</dl>\n''',
'html_body': '''<main>
<p>Not a docinfo.</p>
<dl class="field-list simple">
@@ -440,16 +422,15 @@ Not a docinfo.
<dd><p>list</p>
</dd>
</dl>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
:This is: a
:simple field list with loooong field: names
""",
-"""\
{'fragment': '''\
<p>Not a docinfo.</p>
<dl class="field-list simple">
@@ -459,7 +440,7 @@ Not a docinfo.
<dt>simple field list with loooong field<span class="colon">:</span></dt>
<dd><p>names</p>
</dd>
-</dl>\\n''',
+</dl>\n''',
'html_body': '''\
<main>
<p>Not a docinfo.</p>
@@ -471,9 +452,9 @@ Not a docinfo.
<dd><p>names</p>
</dd>
</dl>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
@@ -482,7 +463,6 @@ Not a docinfo.
:This: is a
:simple: field list with custom indent.
""",
-"""\
{'fragment': '''<p>Not a docinfo.</p>
<dl class="field-list simple" style="--field-indent: 200px;">
<dt>This<span class="colon">:</span></dt>
@@ -491,7 +471,7 @@ Not a docinfo.
<dt>simple<span class="colon">:</span></dt>
<dd><p>field list with custom indent.</p>
</dd>
-</dl>\\n''',
+</dl>\n''',
'html_body': '''<main>
<p>Not a docinfo.</p>
<dl class="field-list simple" style="--field-indent: 200px;">
@@ -502,9 +482,9 @@ Not a docinfo.
<dd><p>field list with custom indent.</p>
</dd>
</dl>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
Not a docinfo.
@@ -514,7 +494,6 @@ Not a docinfo.
:simple: field list without custom indent,
because the unit "uf" is invalid.
""",
-"""\
{'fragment': '''<p>Not a docinfo.</p>
<dl class="field-indent-200uf field-list simple">
<dt>This<span class="colon">:</span></dt>
@@ -524,7 +503,7 @@ Not a docinfo.
<dd><p>field list without custom indent,
because the unit &quot;uf&quot; is invalid.</p>
</dd>
-</dl>\\n''',
+</dl>\n''',
'html_body': '''<main>
<p>Not a docinfo.</p>
<dl class="field-indent-200uf field-list simple">
@@ -536,9 +515,9 @@ because the unit &quot;uf&quot; is invalid.</p>
because the unit &quot;uf&quot; is invalid.</p>
</dd>
</dl>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. figure:: dummy.png
@@ -548,7 +527,6 @@ because the unit &quot;uf&quot; is invalid.</p>
The legend's second paragraph.
""",
-"""\
{'fragment': '''\
<figure>
<img alt="dummy.png" src="dummy.png" />
@@ -559,7 +537,7 @@ because the unit &quot;uf&quot; is invalid.</p>
<p>The legend's second paragraph.</p>
</div>
</figcaption>
-</figure>\\n''',
+</figure>\n''',
'html_body': '''\
<main>
<figure>
@@ -572,22 +550,21 @@ because the unit &quot;uf&quot; is invalid.</p>
</div>
</figcaption>
</figure>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. figure:: dummy.png
The figure's caption, no legend.
""",
-"""\
{'fragment': '''\
<figure>
<img alt="dummy.png" src="dummy.png" />
<figcaption>
<p>The figure's caption, no legend.</p>
</figcaption>
-</figure>\\n''',
+</figure>\n''',
'html_body': '''\
<main>
<figure>
@@ -596,9 +573,9 @@ because the unit &quot;uf&quot; is invalid.</p>
<p>The figure's caption, no legend.</p>
</figcaption>
</figure>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. figure:: dummy.png
@@ -606,7 +583,6 @@ because the unit &quot;uf&quot; is invalid.</p>
A legend without caption.
""",
-"""\
{'fragment': '''\
<figure>
<img alt="dummy.png" src="dummy.png" />
@@ -615,7 +591,7 @@ because the unit &quot;uf&quot; is invalid.</p>
<p>A legend without caption.</p>
</div>
</figcaption>
-</figure>\\n''',
+</figure>\n''',
'html_body': '''\
<main>
<figure>
@@ -626,29 +602,28 @@ because the unit &quot;uf&quot; is invalid.</p>
</div>
</figcaption>
</figure>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. figure:: dummy.png
No caption nor legend.
""",
-"""\
{'fragment': '''\
<figure>
<img alt="dummy.png" src="dummy.png" />
</figure>
-<p>No caption nor legend.</p>\\n''',
+<p>No caption nor legend.</p>\n''',
'html_body': '''\
<main>
<figure>
<img alt="dummy.png" src="dummy.png" />
</figure>
<p>No caption nor legend.</p>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
])
@@ -659,31 +634,29 @@ totest['lazy loading'] = ({'image_loading': 'lazy',
["""\
.. image:: dummy.png
""",
-"""\
{'fragment': '''\
-<img alt="dummy.png" loading="lazy" src="dummy.png" />\\n''',
+<img alt="dummy.png" loading="lazy" src="dummy.png" />\n''',
'html_body': '''\
<main>
<img alt="dummy.png" loading="lazy" src="dummy.png" />
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
["""\
.. figure:: dummy.png
""",
-"""\
{'fragment': '''\
<figure>
<img alt="dummy.png" loading="lazy" src="dummy.png" />
-</figure>\\n''',
+</figure>\n''',
'html_body': '''\
<main>
<figure>
<img alt="dummy.png" loading="lazy" src="dummy.png" />
</figure>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
])
@@ -701,7 +674,6 @@ The latter are referenced a second time [#f2]_ [twice]_.
.. [once] citation referenced once
.. [twice] citation referenced twice
""",
-"""\
{'fragment': '''\
<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
<p>The latter are referenced a second time <a class="footnote-reference brackets" href="#f2" id="footnote-reference-3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> <a class="citation-reference" href="#twice" id="citation-reference-3" role="doc-biblioref">[twice]</a>.</p>
@@ -724,7 +696,7 @@ The latter are referenced a second time [#f2]_ [twice]_.
<span class="label"><span class="fn-bracket">[</span>twice<span class="fn-bracket">]</span></span>
<p>citation referenced twice</p>
</div>
-</div>\\n''',
+</div>\n''',
'html_body': '''\
<main>
<p>Two footnotes <a class="footnote-reference brackets" href="#f1" id="footnote-reference-1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a> <a class="footnote-reference brackets" href="#f2" id="footnote-reference-2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> and two citations <a class="citation-reference" href="#once" id="citation-reference-1" role="doc-biblioref">[once]</a> <a class="citation-reference" href="#twice" id="citation-reference-2" role="doc-biblioref">[twice]</a>.</p>
@@ -749,9 +721,9 @@ The latter are referenced a second time [#f2]_ [twice]_.
<p>citation referenced twice</p>
</div>
</div>
-</main>\\n''',
- 'html_head': '''...<title>&lt;string&gt;</title>\\n'''}
-"""],
+</main>\n''',
+ 'html_head': '''...<title>&lt;string&gt;</title>\n'''
+}],
])