~leonardr/beautifulsoup/bs4

« back to all changes in this revision

Viewing changes to bs4/element.py

  • Committer: Leonard Richardson
  • Date: 2012-04-26 14:45:59 UTC
  • Revision ID: leonard.richardson@canonical.com-20120426144559-ji4ux7bpauogtprt
Upon document generation, CData objects are no longer run through the formatter. [bug=988905]

Show diffs side-by-side

added added

removed removed

Lines of Context:
677
677
    PREFIX = u'<![CDATA['
678
678
    SUFFIX = u']]>'
679
679
 
 
680
    def output_ready(self, formatter="minimal"):
 
681
        """CData strings are passed into the formatter.
 
682
        But the return value is ignored."""
 
683
        self.format_string(self, formatter)
 
684
        return self.PREFIX + self + self.SUFFIX
 
685
 
680
686
 
681
687
class ProcessingInstruction(NavigableString):
682
688
 
791
797
    @string.setter
792
798
    def string(self, string):
793
799
        self.clear()
794
 
        self.append(unicode(string))
 
800
        self.append(string.__class__(string))
795
801
 
796
802
    def _all_strings(self, strip=False):
797
803
        """Yield all child strings, possibly stripping them."""