[FIX] translate: doctype is removed from the backend web template

issue: The rendering is altered because the browser doesn't know how to parse the html and css content
This commit is contained in:
Christophe Matthieu
2016-06-07 14:16:12 +02:00
parent 2179f53a65
commit 3d9ccef81d
+5 -2
View File
@@ -243,8 +243,11 @@ class XMLTranslator(object):
# process children nodes locally in child_trans
child_trans = XMLTranslator(self.callback, self.method, parser=self.parser)
if node.text and not avoid_pattern.match(node.text):
child_trans.todo(escape(node.text))
if node.text:
if avoid_pattern.match(node.text):
child_trans.done(escape(node.text)) # do not translate <!DOCTYPE...
else:
child_trans.todo(escape(node.text))
for child in node:
child_trans.process(child)