@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
17 lines (14 loc) • 421 B
JavaScript
import { isEmpty } from '../utils/is-empty.js';
import { removeMarks } from '../utils/marks.js';
function withEmptyClearFormatting(editor) {
const { onChange } = editor;
editor.onChange = (options) => {
if (isEmpty(editor, editor.children)) {
removeMarks(editor);
}
onChange(options);
};
return editor;
}
export { withEmptyClearFormatting };
//# sourceMappingURL=empty-clear-formatting.js.map