import { PlateEditor } from '@udecode/plate-core';
import { Value } from '@udecode/slate';

export const withCustomBreak = <
  V extends Value = Value,
  E extends PlateEditor<V> = PlateEditor<V>,
>(
  editor: E
) => {
  const { insertBreak } = editor;
  editor.insertBreak = () => {
    insertBreak();
  };

  return editor;
};
