parseInput(input, spec, delimiter) {
        const fields = spec.split(",").map(s => s.trim());
        const input_parts = input.split(new RegExp(delimiter)).map(s => s.trim());
        const zip = (a, b) => Array.from(Array(Math.min(b.length, a.length)), (_, i) => [a[i], b[i]]);
        const r = {};
        zip(fields, input_parts).forEach(f => r[f[0]] = f[1]);
        return r;
    }
/*
    Parse the selected input in the editor, and turn it into values for some of the fields
    - input is the selected text, e.g. "Kevin - old friend - school"
    - spec is the list of field names, e.g. body,overview,tags
    - delimiter is what is between the different fields in the input (in this case " - ")
    */
Parse the selected input in the editor, and turn it into values for some of the fields
input is the selected text, e.g. "Kevin - old friend - school"
spec is the list of field names, e.g. body,overview,tags
delimiter is what is between the different fields in the input (in this case " - ")
Parse the selected input in the editor and turn it into values for some of the fields input is the selected text e . g . " Kevin - old friend - school " spec is the list of field names e . g . body overview tags delimiter is what is between the different fields in the input ( in this case " - " )
parseInput(input, spec, delimiter) {
        const fields = spec.split(",").map(s => s.trim());
        const input_parts = input.split(new RegExp(delimiter)).map(s => s.trim());
        const zip = (a, b) => Array.from(Array(Math.min(b.length, a.length)), (_, i) => [a[i], b[i]]);
        const r = {};
        zip(fields, input_parts).forEach(f => r[f[0]] = f[1]);
        return r;
    }
parseInput ( input , spec , delimiter ) { const fields = spec . split ( "," ) . map ( s => s . trim ( ) ) ; const input_parts = input . split ( new RegExp ( delimiter ) ) . map ( s => s . trim ( ) ) ; const zip = ( a , b ) => Array . from ( Array ( Math . min ( b . length , a . length ) ) , ( _ , i ) => [ a [ i ] , b [ i ] ] ) ; const r = { } ; zip ( fields , input_parts ) . forEach ( f => r [ f [ 0 ] ] = f [ 1 ] ) ; return r ; }
Parse the selected input in the editor, and turn it into values for some of the fields
 input is the selected text, e.g.
Parse the selected input in the editor and turn it into values for some of the fields input is the selected text e . g .