diff --git a/CHANGELOG.md b/CHANGELOG.md index 0272d3a..ca03588 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 #### diff --git a/src/Clone.js b/src/Clone.js index cdc1ff8..c60cc14 100644 --- a/src/Clone.js +++ b/src/Clone.js @@ -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)); } diff --git a/tests/reftests/options/ignore.html b/tests/reftests/options/ignore.html new file mode 100644 index 0000000..1280818 --- /dev/null +++ b/tests/reftests/options/ignore.html @@ -0,0 +1,41 @@ + + + + element render test + + + + + + + +
+ great failure +
+
+ great success +
+ + + +