draft-js
Version:
A React framework for building text editors.
19 lines (16 loc) • 441 B
Flow
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict
* @emails oncall+draft_js
*/
;
const NEWLINE_REGEX = /\r\n?|\n/g;
function splitTextIntoTextBlocks(text: string): Array<string> {
return text.split(NEWLINE_REGEX);
}
module.exports = splitTextIntoTextBlocks;