Skip to content

Commit 925dfe8

Browse files
Update fromHtml plugin to add compatibility with IE11
cn.ownerDocument.body.contains(cn) isn't working fine with IE11. Changing it to !!(cn.ownerDocument.body.compareDocumentPosition(cn) & 16) it do the job in all the browsers. Fix for the Issue IE does not add text #610. #610
1 parent 76edb33 commit 925dfe8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/from_html.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@
495495
}
496496
}
497497
// Only add the text if the text node is in the body element
498-
if (cn.ownerDocument.body.contains(cn)){
498+
//if (cn.ownerDocument.body.contains(cn)){
499+
// Add compatibility with IE11
500+
if(!!(cn.ownerDocument.body.compareDocumentPosition(cn) & 16)){
499501
renderer.addText(value, fragmentCSS);
500502
}
501503
} else if (typeof cn === "string") {

0 commit comments

Comments
 (0)