grunt-html-snapshot
grunt-html-snapshot copied to clipboard
html snapshots angularjs web-site
Hello! I try to use html snapshot tool to make snapshots from angular website. AngularJS adds some information in a header. It looks like this:
<style type="text/css">@charset "UTF-8";
@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}
</style>
After snapshot tool running I get a snapshots with next one:
<style type="text/css">@charset "UTF-8";
[ng\\:cloak
]
,
[ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
display: none !important;
}
ng\\:form {
display: block;
}</style>
It makes my html not valid. How I can change that ?
Here my config is
htmlSnapshot: {
all: {
options: {
snapshotPath: 'snapshots/',
sitePath: 'http://localhost:8002',
urls: [
'/about'
,'/contacts'
],
msWaitForPages: 1000,
sanitize: function (requestUri) {
//returns 'index.html' if the url is '/', otherwise a prefix
if (/\/$/.test(requestUri)) {
return 'index.html';
} else {
return requestUri.replace(/\//g, 'prefix-');
}
},
//if you would rather not keep the script tags in the html snapshots
//set `removeScripts` to true. It's false by default
removeScripts: true
}
}
}