Path: blob/master/src/packages/frontend/editors/slate/plugins.ts
1691 views
export const withIsVoid = (editor) => {1const { isVoid } = editor;23editor.isVoid = (element) => {4if (element === editor) return false;5return element.isVoid != null ? element.isVoid : isVoid(element);6};78return editor;9};1011export const withIsInline = (editor) => {12const { isInline } = editor;1314editor.isInline = (element) => {15// NOTE: we can't just check that element.isInline is not null, since element could be16// the whole editor, which has an inline *method*, which is not null, but also not a boolean.17// See https://github.com/sagemathinc/cocalc/issues/639418return typeof element.isInline == "boolean"19? element.isInline20: isInline(element);21};2223return editor;24};252627