src/js/common/clipboardUtil.js
function(text) {
        // Each newline cell data is wrapping double quotes in the text and
        // newline characters should be replaced with substitution characters temporarily
        // before spliting the text by newline characters.
        text = clipboardUtil.replaceNewlineToSubchar(text);

        return _.map(text.split(/\r?\n/), function(row) {
            return _.map(row.split('\t'), function(column) {
                column = clipboardUtil.removeDoubleQuotes(column);

                return column.replace(CUSTOM_LF_REGEXP, LF)
                    .replace(CUSTOM_CR_REGEXP, CR);
            });
        });
    }
function(text) {
        // Each newline cell data is wrapping double quotes in the text and
        // newline characters should be replaced with substitution characters temporarily
        // before spliting the text by newline characters.
        text = clipboardUtil.replaceNewlineToSubchar(text);

        return _.map(text.split(/\r?\n/), function(row) {
            return _.map(row.split('\t'), function(column) {
                column = clipboardUtil.removeDoubleQuotes(column);

                return column.replace(CUSTOM_LF_REGEXP, LF)
                    .replace(CUSTOM_CR_REGEXP, CR);
            });
        });
    }
function ( text ) { // Each newline cell data is wrapping double quotes in the text and // newline characters should be replaced with substitution characters temporarily // before spliting the text by newline characters. text = clipboardUtil . replaceNewlineToSubchar ( text ) ; return _ . map ( text . split ( / \r?\n / ) , function ( row ) { return _ . map ( row . split ( '\t' ) , function ( column ) { column = clipboardUtil . removeDoubleQuotes ( column ) ; return column . replace ( CUSTOM_LF_REGEXP , LF ) . replace ( CUSTOM_CR_REGEXP , CR ) ; } ) ; } ) ; }
Convert plain text to clipboard data
@param {string} text - Copied plain text
@returns {array} clipboard data (2*2 matrix)
Convert plain text to clipboard data