Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

html snapshots angularjs web-site #29

Open
uaKorona opened this issue Feb 10, 2015 · 0 comments
Open

html snapshots angularjs web-site #29

uaKorona opened this issue Feb 10, 2015 · 0 comments

Comments

@uaKorona
Copy link

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          
                }
            }
        }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant