diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-11-18 22:11:49 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-11-18 22:11:49 +0000 |
commit | 0304e2ae239c44db70bcb85234a188749eba1b87 (patch) | |
tree | 1791ec6739e61a0d198e39ce594cd1bc1c60c0fb /test | |
parent | f9d2bd91e4eba01350158ffd5b8b79753124d03f (diff) | |
download | docutils-0304e2ae239c44db70bcb85234a188749eba1b87.tar.gz |
Smartquotes: correct "educating" of quotes around inline markup.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7537 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test')
-rw-r--r-- | test/test_transforms/test_smartquotes.py | 83 |
1 files changed, 81 insertions, 2 deletions
diff --git a/test/test_transforms/test_smartquotes.py b/test/test_transforms/test_smartquotes.py index 45b1e7ac5..043b79e26 100644 --- a/test/test_transforms/test_smartquotes.py +++ b/test/test_transforms/test_smartquotes.py @@ -34,15 +34,94 @@ totest = {} totest['transitions'] = ((SmartQuotes,), [ ["""\ -Test "smart quotes", 'single smart quotes' +Test "smart quotes", 'single smart quotes', +"'nested' smart" quotes -- and ---also long--- dashes. """, u"""\ <document source="test data"> <paragraph> - Test “smart quotes”, ‘single smart quotes’ + Test “smart quotes”, ‘single smart quotes’, + “‘nested’ smart” quotes – and —also long— dashes. """], +["""\ +Do not "educate" quotes ``inside "literal" text`` and :: + + "literal" blocks. + +Keep quotes straight in code and math: +:code:`print "hello"` :math:`1' 12"`. + +.. code:: + + print "hello" + +.. math:: + + f'(x) = df(x)/dx + +""", +u"""\ +<document source="test data"> + <paragraph> + Do not “educate” quotes + <literal> + inside "literal" text + and + <literal_block xml:space="preserve"> + "literal" blocks. + <paragraph> + Keep quotes straight in code and math: + <literal classes="code"> + print "hello" + + <math> + 1' 12" + . + <literal_block classes="code" xml:space="preserve"> + print "hello" + <math_block xml:space="preserve"> + f'(x) = df(x)/dx +"""], +["""\ +Quotes and inline-elements: + +* Around "_`targets`", "*emphasized*" or "``literal``" text + and links to "targets_". + +* Inside *"emphasized"* or other `inline "roles"` +""", +u"""\ +<document source="test data"> + <paragraph> + Quotes and inline-elements: + <bullet_list bullet="*"> + <list_item> + <paragraph> + Around “ + <target ids="targets" names="targets"> + targets + ”, “ + <emphasis> + emphasized + ” or “ + <literal> + literal + ” text + and links to “ + <reference name="targets" refname="targets"> + targets + ”. + <list_item> + <paragraph> + Inside \n\ + <emphasis> + “emphasized” + or other \n\ + <title_reference> + inline “roles”\ +"""], ]) |