This commit is contained in:
Robert Lehmann
2011-10-03 14:09:19 +02:00
2 changed files with 10 additions and 3 deletions

View File

@@ -193,3 +193,10 @@ def _new_contains(self, key):
return key in self.children
nodes.Node.__contains__ = _new_contains
# monkey-patch Element.copy to copy the rawsource
def _new_copy(self):
return self.__class__(self.rawsource, **self.attributes)
nodes.Element.copy = _new_copy

View File

@@ -127,9 +127,9 @@ def test_latex_escaping():
yield (verify, u'Γ\\\\∞$', None,
ur'\(\Gamma\)\textbackslash{}\(\infty\)\$')
# in verbatim code fragments
yield (verify, u'::\n\n\\∞$[]', None,
u'\\begin{Verbatim}[commandchars=@\\[\\]]\n'
u'@PYGZat[]@(@Gamma@)\\@(@infty@)@$@PYGZlb[]@PYGZrb[]\n'
yield (verify, u'::\n\n\\∞${}', None,
u'\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n'
u'@\\(\\Gamma\\)\\PYGZbs{}\\(\\infty\\)\\$\\PYGZob{}\\PYGZcb{}\n'
u'\\end{Verbatim}')
# in URIs
yield (verify_re, u'`test <http://example.com/~me/>`_', None,