diff options
-rw-r--r-- | tinami.js | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -111,9 +111,14 @@ commands.addUserCommand( range.deleteContents(); doc.documentElement.appendChild(range.createContextualFragment(str)); }else{ - doc=document.implementation.createDocument(null,'html',null); - range=document.createRange(); - range.selectNodeContents(document.documentElement); + let doctype=document.implementation.createDocumentType( + 'html', + '-//W3C//DTD HTML 4.01 Transitional//EN', + 'http://www.w3.org/TR/html4/loose.dtd' + ); + doc=document.implementation.createDocument(null,'html',doctype); + range=doc.createRange(); + range.selectNodeContents(doc.documentElement); let content=doc.adoptNode(range.createContextualFragment(str)); doc.documentElement.appendChild(content); } |