Overview
The insert line break operation creates a soft break within a paragraph, unlike insert paragraph which creates a new block.
Interface
interface InsertLineBreakOperation extends Operation {
type: 'insertLineBreak';
path: Path;
}Usage
function insertLineBreak(editor: Editor, position: Path) {
const operation: InsertLineBreakOperation = {
type: 'insertLineBreak',
path: position
};
editor.applyOperation(operation);
}
// Inverse: Delete line break
const inverse = {
type: 'deleteText',
path: position,
length: 1
};