dist/plugin.js
/** The rewrite-paths plugin for PostHTML. */
The rewrite-paths plugin for PostHTML.
The rewrite - paths plugin for PostHTML .
function rewritePathsPlugin(options) {
    const search = options.search || searchDefault;
    const processorFuture = getPathMap(options.pathMap).then(buildProcessor);
    return function (tree) {
        return processorFuture.then(processor => {
            tree.walk(node => {
                if (node.attrs && node.tag) {
                    const searchAttrs = search[node.tag];
                    if (searchAttrs) {
                        for (var attr of searchAttrs)
                            if (node.attrs[attr]) {
                                processor(node, attr);
                            }
                    }
                }
                return node;
            });
            return tree;
        });
    };
}
function rewritePathsPlugin ( options ) { const search = options . search || searchDefault ; const processorFuture = getPathMap ( options . pathMap ) . then ( buildProcessor ) ; return function ( tree ) { return processorFuture . then ( processor => { tree . walk ( node => { if ( node . attrs && node . tag ) { const searchAttrs = search [ node . tag ] ; if ( searchAttrs ) { for ( var attr of searchAttrs ) if ( node . attrs [ attr ] ) { processor ( node , attr ) ; } } } return node ; } ) ; return tree ; } ) ; } ; }
The rewrite-paths plugin for PostHTML.
The rewrite - paths plugin for PostHTML .