27
settings = {'smart_quotes': True}
27
28
s = DocutilsTestSupport.TransformTestSuite(
28
parser, suite_settings={'smart_quotes': True})
29
parser, suite_settings=settings)
29
30
s.generateTests(totest)
31
settings['language_code'] = 'de'
32
s.generateTests(totest_de)
33
settings['smart_quotes'] = 'alternative'
34
s.generateTests(totest_de_alt)
35
42
totest['transitions'] = ((SmartQuotes,), [
37
Test "smart quotes", 'single smart quotes'
44
Test "smart quotes", 'single smart quotes',
45
"'nested' smart" quotes
38
46
-- and ---also long--- dashes.
41
49
<document source="test data">
43
Test “smart quotes”, ‘single smart quotes’
51
Test “smart quotes”, ‘single smart quotes’,
52
“‘nested’ smart” quotes
44
53
– and —also long— dashes.
56
Do not "educate" quotes ``inside "literal" text`` and ::
60
Keep quotes straight in code and math:
61
:code:`print "hello"` :math:`1' 12"`.
73
<document source="test data">
75
Do not “educate” quotes
79
<literal_block xml:space="preserve">
82
Keep quotes straight in code and math:
83
<literal classes="code">
89
<literal_block classes="code" xml:space="preserve">
91
<math_block xml:space="preserve">
95
Quotes and inline-elements:
97
* Around "_`targets`", "*emphasized*" or "``literal``" text
98
and links to "targets_".
100
* Inside *"emphasized"* or other `inline "roles"`
103
<document source="test data">
105
Quotes and inline-elements:
106
<bullet_list bullet="*">
110
<target ids="targets" names="targets">
120
<reference name="targets" refname="targets">
133
.. class:: language-de
135
German "smart quotes" and 'single smart quotes'.
137
.. class:: language-foo
139
"Quoting style" for unknown languages is 'ASCII'.
141
.. class:: language-de-x-altquot
143
Alternative German "smart quotes" and 'single smart quotes'.
146
<document source="test data">
147
<paragraph classes="language-de">
148
German „smart quotes“ and ‚single smart quotes‘.
149
<paragraph classes="language-foo">
150
"Quoting style" for unknown languages is 'ASCII'.
151
<paragraph classes="language-de-x-altquot">
152
Alternative German »smart quotes« and ›single smart quotes‹.
153
<system_message level="2" line="7" source="test data" type="WARNING">
155
No smart quotes defined for language "foo".
159
totest_de['transitions'] = ((SmartQuotes,), [
161
German "smart quotes" and 'single smart quotes'.
163
.. class:: language-en-UK
165
English "smart quotes" and 'single smart quotes'.
168
<document source="test data">
170
German „smart quotes“ and ‚single smart quotes‘.
171
<paragraph classes="language-en-uk">
172
English “smart quotes” and ‘single smart quotes’.
176
totest_de_alt['transitions'] = ((SmartQuotes,), [
178
Alternative German "smart quotes" and 'single smart quotes'.
180
.. class:: language-en-UK
182
English "smart quotes" and 'single smart quotes' have no alternative.
184
.. class:: language-ro
186
Alternative Romanian "smart quotes" and 'single' smart quotes.
189
<document source="test data">
191
Alternative German »smart quotes« and ›single smart quotes‹.
192
<paragraph classes="language-en-uk">
193
English “smart quotes” and ‘single smart quotes’ have no alternative.
194
<paragraph classes="language-ro">
195
Alternative Romanian «smart quotes» and „single” smart quotes.
49
199
if __name__ == '__main__':