diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2018-11-20 23:55:18 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2018-11-20 23:55:18 +0000 |
commit | e3464eabc52829aeecad3db352a02e8f0e29a4a8 (patch) | |
tree | e57f39d78e6a9af01eb5fc0f63237f85abe48476 | |
parent | e5e93069b47d7e8b67c2dfc06c8bdc75a3e375fe (diff) | |
download | docutils-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.py | 4 |
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 |