Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions jspdf.plugin.from_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,10 @@
};
}
}
renderer.addText(value, fragmentCSS);
// Only add the text if the text node is in the body element
if (cn.ownerDocument.body.contains(cn)){
renderer.addText(value, fragmentCSS);
}
} else if (typeof cn === "string") {
renderer.addText(cn, fragmentCSS);
}
Expand Down Expand Up @@ -619,7 +622,9 @@
$hiddendiv.innerHTML = "<iframe style=\"height:1px;width:1px\" name=\"" + framename + "\" />";
document.body.appendChild($hiddendiv);
$frame = window.frames[framename];
$frame.document.body.innerHTML = element;
$frame.document.open();
$frame.document.writeln(element);
$frame.document.close();
return $frame.document.body;
})(element.replace(/<\/?script[^>]*?>/gi, ''));
}
Expand Down