Esempio n. 1
0
 def parse_xhtml(self, data, fname='<string>'):
     if self.tweak_mode:
         return parse_html_tweak(data, log=self.log, decoder=self.decode)
     else:
         try:
             return parse_html(
                 data, log=self.log, decoder=self.decode,
                 preprocessor=self.html_preprocessor, filename=fname,
                 non_html_file_tags={'ncx'})
         except NotHTML:
             return self.parse_xml(data)
Esempio n. 2
0
 def parse_xhtml(self, data, fname='<string>'):
     if self.tweak_mode:
         return parse_html_tweak(data, log=self.log, decoder=self.decode)
     else:
         try:
             return parse_html(
                 data, log=self.log, decoder=self.decode,
                 preprocessor=self.html_preprocessor, filename=fname,
                 non_html_file_tags={'ncx'})
         except NotHTML:
             return self.parse_xml(data)