dist/crocodoc.viewer.js
function processSVGContent(text) {
        if (destroyed) {
            return;
        }

        var query = config.queryString.replace('&', '&#38;'),
            dataUrlCount;

        dataUrlCount = util.countInStr(text, 'xlink:href="data:image');
        // remove data:urls from the SVG content if the number exceeds MAX_DATA_URLS
        if (dataUrlCount > MAX_DATA_URLS) {
            // remove all data:url images that are smaller than 5KB
            text = text.replace(/<image[\s\w-_="]*xlink:href="data:image\/[^"]{0,5120}"[^>]*>/ig, '');
        }

        // @TODO: remove this, because we no longer use any external assets in this way
        // modify external asset urls for absolute path
        text = text.replace(/href="([^"#:]*)"/g, function (match, group) {
            return 'href="' + config.url + group + query + '"';
        });

        return scope.get('stylesheet').then(function (cssText) {
            return interpolateCSSText(text, cssText);
        });
    }
function processSVGContent(text) {
        if (destroyed) {
            return;
        }

        var query = config.queryString.replace('&', '&#38;'),
            dataUrlCount;

        dataUrlCount = util.countInStr(text, 'xlink:href="data:image');
        // remove data:urls from the SVG content if the number exceeds MAX_DATA_URLS
        if (dataUrlCount > MAX_DATA_URLS) {
            // remove all data:url images that are smaller than 5KB
            text = text.replace(/<image[\s\w-_="]*xlink:href="data:image\/[^"]{0,5120}"[^>]*>/ig, '');
        }

        // @TODO: remove this, because we no longer use any external assets in this way
        // modify external asset urls for absolute path
        text = text.replace(/href="([^"#:]*)"/g, function (match, group) {
            return 'href="' + config.url + group + query + '"';
        });

        return scope.get('stylesheet').then(function (cssText) {
            return interpolateCSSText(text, cssText);
        });
    }
function processSVGContent ( text ) { if ( destroyed ) { return ; } var query = config . queryString . replace ( '&' , '&#38;' ) , dataUrlCount ; dataUrlCount = util . countInStr ( text , 'xlink:href="data:image' ) ; // remove data:urls from the SVG content if the number exceeds MAX_DATA_URLS if ( dataUrlCount > MAX_DATA_URLS ) { // remove all data:url images that are smaller than 5KB text = text . replace ( / <image[\s\w-_="]*xlink:href="data:image\/[^"]{0,5120}"[^>]*> / ig , '' ) ; } // @TODO: remove this, because we no longer use any external assets in this way // modify external asset urls for absolute path text = text . replace ( / href="([^"#:]*)" / g , function ( match , group ) { return 'href="' + config . url + group + query + '"' ; } ) ; return scope . get ( 'stylesheet' ) . then ( function ( cssText ) { return interpolateCSSText ( text , cssText ) ; } ) ; }
Process SVG text and return the embeddable result
@param   {string} text The original SVG text
@returns {string}      The processed SVG text
@private
Process SVG text and return the embeddable result