summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 13:48:06 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 13:48:06 -0500
commit1cc507c9ac0154904a65f7352736cb665686e4a4 (patch)
treec454bcae32c7a02a1cf740ff41631d470d490fea /bs4/element.py
parent4e502b398eddc677567538d5356a855137e155f7 (diff)
On output, always convert special XML characters to entities.
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 8451d7c..7c72894 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -400,7 +400,7 @@ class NavigableString(unicode, PageElement):
if substitute_html_entities:
output = EntitySubstitution.substitute_html(self)
else:
- output = self
+ output = EntitySubstitution.substitute_xml(self)
return self.PREFIX + output + self.SUFFIX
@@ -668,7 +668,7 @@ class Tag(PageElement):
def __str__(self):
return self.encode()
-
+
if PY3K:
__str__ = __repr__ = __unicode__