text: import { Editor } from '@tiptap/vue-3';
  import StarterKit from '@tiptap/starter-kit';
  import Highlight from '@tiptap/extension-highlight';
  import Typography from '@tiptap/extension-typography';
  import Underline from '@tiptap/extension-underline';
  import Link from '@tiptap/extension-link';
  import Code from '@tiptap/extension-code';
  import Placeholder from '@tiptap/extension-placeholder';
  import TaskList from '@tiptap/extension-task-list';
  import TaskItem from '@tiptap/extension-task-item';
  import LabelSuggestion from './exts/label-suggestion';
  import MathInline from './exts/math-inline';
  import MathBlock from './exts/math-block';
  import CodeBlock from './exts/code-block';
  import LinkNote from './exts/link-note';
  import Search from './exts/search';
  import Image from './exts/image';
  
  export const extensions = [
    StarterKit,
    Highlight,
    Typography,
    Underline,
    LinkNote,
    LabelSuggestion,
    TaskList,
    TaskItem,
    CodeBlock,
    MathInline,
    MathBlock,
    Image,
    Search,
    Placeholder,
    Code.configure({ HTMLAttributes: { class: 'inline-code' } }),
    Link.extend({
      addKeyboardShortcuts() {
        return {
          'Mod-k': () => this.editor.chain().focus().toggleLink().run(),
        };
      },
    }).configure({
      openOnClick: false,
      HTMLAttributes: {
        target: '_blank',
        rel: 'noopener noreferrer nofollow',
        'tiptap-url': 'true',
        title: 'Ctrl+Click to open URL',
      },
    }),
  ];
  
  export default function ({ extensions: optsExts, ...opts }) {
    const instance = new Editor({
      ...opts,
      extensions: [...extensions, ...(optsExts || [])],
    });
  
    return instance;
  }
  