next.js/examples/cms-payload/payload/fields/richText/label/plugin.ts
plugin.ts12 lines282 B
const withLabel = (incomingEditor) => {
  const editor = incomingEditor;
  const { shouldBreakOutOnEnter } = editor;

  editor.shouldBreakOutOnEnter = (element) =>
    element.type === "label" ? true : shouldBreakOutOnEnter(element);

  return editor;
};

export default withLabel;
Quest for Codev2.0.0
/
SIGN IN