mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix data-html2canvas-ignore attribute (Fix #1253)
This commit is contained in:
parent
4a09264103
commit
9db8580b97
@ -1,6 +1,7 @@
|
||||
### Changelog ###
|
||||
|
||||
#### v1.0.0-alpha2 - TBD ####
|
||||
* Fix `data-html2canvas-ignore` attribute
|
||||
* Fix decimal `letter-spacing` values
|
||||
|
||||
#### v1.0.0-alpha1 - 5.12.2017 ####
|
||||
|
@ -233,7 +233,10 @@ export class DocumentCloner {
|
||||
}
|
||||
|
||||
for (let child = node.firstChild; child; child = child.nextSibling) {
|
||||
if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT') {
|
||||
if (
|
||||
child.nodeType !== Node.ELEMENT_NODE ||
|
||||
(child.nodeName !== 'SCRIPT' && !child.hasAttribute('data-html2canvas-ignore'))
|
||||
) {
|
||||
if (!this.copyStyles || child.nodeName !== 'STYLE') {
|
||||
clone.appendChild(this.cloneNode(child));
|
||||
}
|
||||
|
41
tests/reftests/options/ignore.html
Normal file
41
tests/reftests/options/ignore.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>element render test</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script>
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="../../test.js"></script>
|
||||
<style>
|
||||
#div1 {
|
||||
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
}
|
||||
|
||||
#ignored {
|
||||
background: red;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="ignored" data-html2canvas-ignore>
|
||||
great failure
|
||||
</div>
|
||||
<div id="div1">
|
||||
great success
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user