summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lehmann <mail@robertlehmann.de>2011-10-03 14:09:19 +0200
committerRobert Lehmann <mail@robertlehmann.de>2011-10-03 14:09:19 +0200
commit60f8c42f385ed1478ff36c6a42fa3316a6506ece (patch)
tree30422782a06e41857c23281ec214a76680b0363a
parente8a30815cff0aec7a5bfb8dd1482a13433c0db3c (diff)
parenta1eef6bd2f8a207e0bd18dcc3c08e2d58f816909 (diff)
downloadsphinx-60f8c42f385ed1478ff36c6a42fa3316a6506ece.tar.gz
merge
-rw-r--r--sphinx/util/nodes.py7
-rw-r--r--tests/test_markup.py6
2 files changed, 10 insertions, 3 deletions
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py
index 49f3a212..c2b7edf4 100644
--- a/sphinx/util/nodes.py
+++ b/sphinx/util/nodes.py
@@ -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
diff --git a/tests/test_markup.py b/tests/test_markup.py
index 5d56bea3..4c8e7264 100644
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -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,