Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

336 B
Raw Blame
import type { Editor } from '@tiptap/core';
import type { Doc } from 'yjs';

export function getYDoc(editor: Editor): Doc | undefined {
  if (editor.isDestroyed) return undefined;
  const collabExt = editor.extensionManager.extensions.find((e) => e.name === 'collaboration');
  return collabExt?.options?.document as Doc | undefined;
}