[py-svn] r34855 - in py/dist/py/rest: . testing

guido at codespeak.net guido at codespeak.net
Wed Nov 22 13:56:36 CET 2006


Author: guido
Date: Wed Nov 22 13:56:34 2006
New Revision: 34855

Modified:
   py/dist/py/rest/rst.py
   py/dist/py/rest/testing/test_rst.py
Log:
Fixed bug in title escaping.


Modified: py/dist/py/rest/rst.py
==============================================================================
--- py/dist/py/rest/rst.py	(original)
+++ py/dist/py/rest/rst.py	Wed Nov 22 13:56:34 2006
@@ -206,7 +206,7 @@
     def _get_text(self):
         txt = []
         for node in self.children:
-            txt.append(node.text().strip())
+            txt += node.wordlist()
         return ' '.join(txt)
 
 class AbstractText(AbstractNode):

Modified: py/dist/py/rest/testing/test_rst.py
==============================================================================
--- py/dist/py/rest/testing/test_rst.py	(original)
+++ py/dist/py/rest/testing/test_rst.py	Wed Nov 22 13:56:34 2006
@@ -191,6 +191,11 @@
                    "=============================")
     checkrest(txt)
 
+def test_title_escaping():
+    txt = Title('foo *bar* baz').text()
+    assert txt == 'foo \\*bar\\* baz\n==============='
+    checkrest(txt)
+
 def test_link():
     expected = "`some link`_\n\n.. _`some link`: http://codespeak.net\n\n"
     txt = Rest(Paragraph(Link("some link", "http://codespeak.net"))).text()



More information about the pytest-commit mailing list