Files
docmost/apps/client/src/features/editor/utils/is-custom-node-selected.ts
T
Philipinho eefe63d1cd implement new invitation system
* fix comments on the frontend
* move jwt token service to its own module
* other fixes and updates
2024-05-14 22:55:11 +01:00

12 lines
384 B
TypeScript

import { Editor } from "@tiptap/react";
import TiptapLink from "@tiptap/extension-link";
import { CodeBlock } from "@tiptap/extension-code-block";
export const isCustomNodeSelected = (editor: Editor, node: HTMLElement) => {
const customNodes = [CodeBlock.name, TiptapLink.name];
return customNodes.some((type) => editor.isActive(type));
};
export default isCustomNodeSelected;