UNPKG

612 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 *
9 * @emails oncall+draft_js
10 */
11'use strict';
12
13var DraftModifier = require("./DraftModifier");
14
15var EditorState = require("./EditorState");
16
17function keyCommandInsertNewline(editorState) {
18 var contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());
19 return EditorState.push(editorState, contentState, 'split-block');
20}
21
22module.exports = keyCommandInsertNewline;
\No newline at end of file