aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormitsugu oyama2010-11-03 08:38:58 +0900
committermitsugu oyama2010-11-03 08:38:58 +0900
commitf649b4cf72f93915bf2501622f719d218eaf575d (patch)
tree4ec1bfb87d881366f251b36cff930509bdeddc63
parent261d7bedb18cc771c29ca571ce01a484274d1bd1 (diff)
downloadvimperator-plugins-f649b4cf72f93915bf2501622f719d218eaf575d.tar.bz2
HTMLDocument生成部の修正
Firefox 3.6.x以前のOld Version対応
-rw-r--r--tinami.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/tinami.js b/tinami.js
index 46d781b..a4b0fd5 100644
--- a/tinami.js
+++ b/tinami.js
@@ -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);
}