From 6a8fa5523c6783fc407a9f49f7b446d8f4327e8e Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sat, 26 Feb 2011 23:42:54 -0500 Subject: Made EntitySubstitution a utility class, not the kind of class you subclass. --- beautifulsoup/element.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'beautifulsoup/element.py') diff --git a/beautifulsoup/element.py b/beautifulsoup/element.py index 6af27a8..61ed4ab 100644 --- a/beautifulsoup/element.py +++ b/beautifulsoup/element.py @@ -11,7 +11,7 @@ from util import isList DEFAULT_OUTPUT_ENCODING = "utf-8" -class PageElement(EntitySubstitution): +class PageElement(object): """Contains the navigational information for some part of the page (either a tag or a piece of text)""" @@ -363,7 +363,7 @@ class NavigableString(unicode, PageElement): def output_ready(self, substitute_html_entities=False): if substitute_html_entities: - output = self.substitute_html(self) + output = EntitySubstitution.substitute_html(self) else: output = self return self.PREFIX + output + self.SUFFIX @@ -580,7 +580,8 @@ class Tag(PageElement): and '%SOUP-ENCODING%' in val): val = self.substituteEncoding(val, eventual_encoding) - decoded = key + '=' + self.substitute_xml(val, True) + decoded = (key + '=' + + EntitySubstitution.substitute_xml(val, True)) attrs.append(decoded) close = '' closeTag = '' -- cgit v1.2.3