From 11a7aa2e8ea588071deb9be27fb4d6ca822e5465 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Tue, 20 Dec 2011 16:38:05 +0000 Subject: [PATCH] Update libhtml.py to handle html5 and make html5 the default -- extra stuff svn: r18642 --- src/plugins/lib/libhtml.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/lib/libhtml.py b/src/plugins/lib/libhtml.py index cef7ec79d..c78087a29 100644 --- a/src/plugins/lib/libhtml.py +++ b/src/plugins/lib/libhtml.py @@ -60,6 +60,8 @@ __all__ = ['Html'] # # XHTML DOCTYPE constants to be used in statements # +# Reference: http://www.w3.org/QA/2002/04/valid-dtd-list.html +# #------------------------------------------------------------------------ _XHTML10_STRICT = '"-//W3C//DTD XHTML 1.0 Strict//EN"\n' \ @@ -427,8 +429,8 @@ class Html(list): ) self[0:0] = [xmldecl] # - def addDOCTYPE(self, name='html', public='PUBLIC', - external_id=_XHTML10_STRICT, *args): + def addDOCTYPE(self, name='HTML', public='', + external_id=_HTML5, *args): """ Add a DOCTYPE statement to the start of the list @@ -441,12 +443,14 @@ class Html(list): :param args: 0 or more positional parameters to be added to this DOCTYPE. """ - doctype = '' % ( - name, - public, - external_id, - ' %s'*len(args) % args - ) + doctype = ( + '' # Note: DOCTYPE declaration must follow XML declaration if len(self) and self[0][:6] == '