index.js
function getBlockOptions(annotation, defaults) {
    const optionValues = annotation.split(/\w+\:/)
        .map((item) => item.replace(/<!--\s?|\s?-->|^\s+|\s+$/, ''))
        .filter((item) => !!item.length);
    const optionKeys = annotation.match(/(\w+)\:/gi).map((item) => item.replace(/[^\w]/, ''));

    defaults = defaults || {
            wrap: {before: '', after: ''}
        };

    const opts = {};

    optionValues.forEach((v, i) => {
        const k = optionKeys[i];

        if (typeof k !== 'string') {
            return;
        }

        // Treat option value as array if it has a colon
        // @todo: Allow escaped colons to be ignored
        // RegEx lookbehind negate does not work :(
        // Should be /(?<!\\):/
        if (v.indexOf(':') > -1) {
            v = v.split(':');
        }

        opts[k] = v;
    });

    // Process options
    opts.wrap = formalizeWrap(opts.wrap || defaults.wrap);

    return opts;
}
function getBlockOptions(annotation, defaults) {
    const optionValues = annotation.split(/\w+\:/)
        .map((item) => item.replace(/<!--\s?|\s?-->|^\s+|\s+$/, ''))
        .filter((item) => !!item.length);
    const optionKeys = annotation.match(/(\w+)\:/gi).map((item) => item.replace(/[^\w]/, ''));

    defaults = defaults || {
            wrap: {before: '', after: ''}
        };

    const opts = {};

    optionValues.forEach((v, i) => {
        const k = optionKeys[i];

        if (typeof k !== 'string') {
            return;
        }

        // Treat option value as array if it has a colon
        // @todo: Allow escaped colons to be ignored
        // RegEx lookbehind negate does not work :(
        // Should be /(?<!\\):/
        if (v.indexOf(':') > -1) {
            v = v.split(':');
        }

        opts[k] = v;
    });

    // Process options
    opts.wrap = formalizeWrap(opts.wrap || defaults.wrap);

    return opts;
}
function getBlockOptions ( annotation , defaults ) { const optionValues = annotation . split ( / \w+\: / ) . map ( ( item ) => item . replace ( / <!--\s?|\s?-->|^\s+|\s+$ / , '' ) ) . filter ( ( item ) => ! ! item . length ) ; const optionKeys = annotation . match ( / (\w+)\: / gi ) . map ( ( item ) => item . replace ( / [^\w] / , '' ) ) ; defaults = defaults || { wrap : { before : '' , after : '' } } ; const opts = { } ; optionValues . forEach ( ( v , i ) => { const k = optionKeys [ i ] ; if ( typeof k !== 'string' ) { return ; } // Treat option value as array if it has a colon // @todo: Allow escaped colons to be ignored // RegEx lookbehind negate does not work :( // Should be /(?<!\\):/ if ( v . indexOf ( ':' ) > - 1 ) { v = v . split ( ':' ) ; } opts [ k ] = v ; } ) ; // Process options opts . wrap = formalizeWrap ( opts . wrap || defaults . wrap ) ; return opts ; }
read options from annotation

e.g.: <!-- extract:content/element.html wrap:<div class="wrapper-element">:</div> -->
becomes:
{
extract: 'content/element.html',
wrap: {before: '<div class="wrapper-element">', after: '</div>'}
}

@param annotation
@param defaults
@returns {{}}
read options from annotation