equal
deleted
inserted
replaced
979 |
979 |
980 @nocoverage |
980 @nocoverage |
981 def _check_html(self, output, view, template='main-template'): |
981 def _check_html(self, output, view, template='main-template'): |
982 """raises an exception if the HTML is invalid""" |
982 """raises an exception if the HTML is invalid""" |
983 output = output.strip() |
983 output = output.strip() |
|
984 if isinstance(output, text_type): |
|
985 # XXX |
|
986 output = output.encode('utf-8') |
984 validator = self.get_validator(view, output=output) |
987 validator = self.get_validator(view, output=output) |
985 if validator is None: |
988 if validator is None: |
986 return output # return raw output if no validator is defined |
989 return output # return raw output if no validator is defined |
987 if isinstance(validator, htmlparser.DTDValidator): |
990 if isinstance(validator, htmlparser.DTDValidator): |
988 # XXX remove <canvas> used in progress widget, unknown in html dtd |
991 # XXX remove <canvas> used in progress widget, unknown in html dtd |