diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2018-11-21 13:58:51 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2018-11-21 13:58:51 +0000 |
| commit | 556aec900cdaccbec3fce287e7af69e82d80ea53 (patch) | |
| tree | e57f39d78e6a9af01eb5fc0f63237f85abe48476 /docutils/test/test_transforms | |
| parent | b95bd7805b9b5f859410758ce3c1ef6177e1a8cc (diff) | |
| download | docutils-556aec900cdaccbec3fce287e7af69e82d80ea53.tar.gz | |
Revert the fix for backslash escaping in transforms.
Still waiting for review.
Reverts last three commits from a local "feature branch"
unintentionally applied to trunk with `git svn`.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/test_transforms')
| -rw-r--r-- | docutils/test/test_transforms/test_smartquotes.py | 117 |
1 files changed, 8 insertions, 109 deletions
diff --git a/docutils/test/test_transforms/test_smartquotes.py b/docutils/test/test_transforms/test_smartquotes.py index 2604a1e40..7e9613b78 100644 --- a/docutils/test/test_transforms/test_smartquotes.py +++ b/docutils/test/test_transforms/test_smartquotes.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# $Id: test_smartquotes.py 8190 2017-10-25 13:57:27Z milde $ +# $Id$ # # :Copyright: © 2011 Günter Milde. # :Maintainer: docutils-develop@lists.sourceforge.net @@ -24,8 +24,7 @@ from docutils.parsers.rst import Parser def suite(): parser = Parser() - settings = {'smart_quotes': True, - 'trim_footnote_ref_space': True} + settings = {'smart_quotes': True} s = DocutilsTestSupport.TransformTestSuite( parser, suite_settings=settings) s.generateTests(totest) @@ -44,7 +43,7 @@ totest_de = {} totest_de_alt = {} totest_locales = {} -totest['smartquotes'] = ((SmartQuotes,), [ +totest['transitions'] = ((SmartQuotes,), [ ["""\ Test "smart quotes", 'secondary smart quotes', "'nested' smart" quotes @@ -57,7 +56,7 @@ u"""\ “‘nested’ smart” quotes – and —also long— dashes. """], -[r"""Escaped \"ASCII quotes\" and \'secondary ASCII quotes\'. +[r"""Escaped \\"ASCII quotes\\" and \\'secondary ASCII quotes\\'. """, u"""\ <document source="test data"> @@ -114,7 +113,6 @@ em space "a" 'a', NBSP "a" 'a', ZWSP\u200B"a" and\u200B'a', ZWNJ\u200C"a" and\u200C'a', -escaped space\ "a" and\ 'a', —"a",—'a' en dash–"a"–'a', @@ -133,7 +131,6 @@ u"""\ NBSP “a” ‘a’, ZWSP\u200B“a” and\u200B‘a’, ZWNJ\u200C“a” and\u200C‘a’, - escaped space“a” and‘a’, <paragraph> —“a”,—‘a’ en dash–“a”–‘a’, @@ -199,7 +196,7 @@ Do not convert context-character at inline-tag boundaries and links to "targets_". Inside *"emphasized"* or other `inline "roles"`: - (``"string"``), (``'string'``), *\"betont\"*, \"*betont*". + (``"string"``), (``'string'``), *\\"betont\\"*, \\"*betont*". Do not drop characters from intra-word inline markup like *re*\ ``Structured``\ *Text*. @@ -255,104 +252,6 @@ u"""\ Text . """], -[r""" -Docutils escape mechanism uses the backslash: - -\Remove \non-escaped \backslashes\: -\item \newline \tab \" \' \*. - -\ Remove-\ escaped-\ white\ space-\ -including-\ newlines. - -\\Keep\\escaped\\backslashes\\ -(but\\only\\one). - -\\ Keep \\ space\\ around \\ backslashes. - -Keep backslashes ``\in\ literal``, :math:`in \mathrm{math}`, -and :code:`in\ code`. - -Test around inline elements:\ [*]_ - -*emphasized*, H\ :sub:`2`\ O and :math:`x^2` - -*emphasized*, H\ :sub:`2`\ O and :math:`x^2` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. [*] and footnotes -""", -u"""\ -<document source="test data"> - <paragraph> - Docutils escape mechanism uses the backslash: - <paragraph> - Remove non-escaped backslashes: - item newline tab " \' *. - <paragraph> - Remove-escaped-whitespace-including-newlines. - <paragraph> - \\Keep\\escaped\\backslashes\\ - (but\\only\\one). - <paragraph> - \\ Keep \\ space\\ around \\ backslashes. - <paragraph> - Keep backslashes \n\ - <literal> - \\in\\ literal - , \n\ - <math> - in \\mathrm{math} - , - and \n\ - <literal classes="code"> - in\\ code - . - <paragraph> - Test around inline elements: - <footnote_reference auto="*" ids="id1"> - <paragraph> - <emphasis> - emphasized - , H - <subscript> - 2 - O and \n\ - <math> - x^2 - <section ids="emphasized-h2o-and-x-2" names="emphasized,\\ h2o\\ and\\ x^2"> - <title> - <emphasis> - emphasized - , H - <subscript> - 2 - O and \n\ - <math> - x^2 - <footnote auto="*" ids="id2"> - <paragraph> - and footnotes -"""], -[r""" -Character-level m\ *a*\ **r**\ ``k``\ `u`:title:\p -with backslash-escaped whitespace, including new\ -lines. -""", -"""\ -<document source="test data"> - <paragraph> - Character-level m - <emphasis> - a - <strong> - r - <literal> - k - <title_reference> - u - p - with backslash-escaped whitespace, including newlines. -"""], ["""\ .. class:: language-de @@ -388,7 +287,7 @@ u"""\ """], ]) -totest_de['smartquotes'] = ((SmartQuotes,), [ +totest_de['transitions'] = ((SmartQuotes,), [ ["""\ German "smart quotes" and 'secondary smart quotes'. @@ -405,7 +304,7 @@ u"""\ """], ]) -totest_de_alt['smartquotes'] = ((SmartQuotes,), [ +totest_de_alt['transitions'] = ((SmartQuotes,), [ ["""\ Alternative German "smart quotes" and 'secondary smart quotes'. @@ -434,7 +333,7 @@ u"""\ """], ]) -totest_locales['smartquotes'] = ((SmartQuotes,), [ +totest_locales['transitions'] = ((SmartQuotes,), [ ["""\ German "smart quotes" and 'secondary smart quotes'. |
