summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2018-11-20 23:55:18 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2018-11-20 23:55:18 +0000
commite3464eabc52829aeecad3db352a02e8f0e29a4a8 (patch)
treee57f39d78e6a9af01eb5fc0f63237f85abe48476
parente5e93069b47d7e8b67c2dfc06c8bdc75a3e375fe (diff)
downloaddocutils-e3464eabc52829aeecad3db352a02e8f0e29a4a8.tar.gz
Unescape null-escaped content in nodes.Text.astext().
Enables the use of null-escaped source in Text nodes. The escaping can then be used in transforms acting on the doctree. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8232 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/docutils/nodes.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py
index b19970b09..9265717ea 100644
--- a/docutils/docutils/nodes.py
+++ b/docutils/docutils/nodes.py
@@ -29,6 +29,8 @@ import warnings
import types
import unicodedata
+import docutils.utils
+
# ==============================
# Functional Node Base Classes
# ==============================
@@ -358,7 +360,7 @@ class Text(Node, reprunicode):
return domroot.createTextNode(unicode(self))
def astext(self):
- return reprunicode(self)
+ return reprunicode(docutils.utils.unescape(self))
# Note about __unicode__: The implementation of __unicode__ here,
# and the one raising NotImplemented in the superclass Node had