--- a/devtools/testlib.py Wed May 15 14:22:51 2013 +0200
+++ b/devtools/testlib.py Wed May 15 16:21:23 2013 +0200
@@ -889,8 +889,12 @@
content_type = view.content_type
if content_type is None:
content_type = 'text/html'
- if content_type in ('text/html', 'application/xhtml+xml'):
- if output and output.startswith('<?xml'):
+ if content_type in ('text/html', 'application/xhtml+xml') and output:
+ if output.startswith('<!DOCTYPE html>'):
+ # only check XML well-formness since HTMLValidator isn't html5
+ # compatible and won't like various other extensions
+ default_validator = htmlparser.XMLSyntaxValidator
+ elif output.startswith('<?xml'):
default_validator = htmlparser.DTDValidator
else:
default_validator = htmlparser.HTMLValidator