tiptap-commonmark
Version:
A starter-kit for the tiptap editor, based on CommonMark
28 lines (27 loc) • 1.05 kB
TypeScript
import { Extension } from '@tiptap/core';
import { type CodeBlockOptions } from '@tiptap/extension-code-block';
import { type CodeBlockLowlightOptions } from '@tiptap/extension-code-block-lowlight';
import { type HardBreakOptions } from '@tiptap/extension-hard-break';
import { type HeadingOptions } from '@tiptap/extension-heading';
import { type ImageOptions } from '@tiptap/extension-image';
import { type LinkOptions } from '@tiptap/extension-link';
export interface CommonMarkOptions {
/**
* @default false
*/
useLowlight?: boolean;
heading?: HeadingOptions;
codeBlock?: CodeBlockOptions | CodeBlockLowlightOptions;
link?: LinkOptions;
image?: ImageOptions;
hardBreak?: HardBreakOptions;
}
/**
* CommonMark for Tiptap
*
* Note that editor commands have not been altered. They may not be compatible with CommonMark syntax.
*
* @link See the CommonMark spec <https://spec.commonmark.org/0.31.2/#blocks-and-inlines>
*/
declare const CommonMark: Extension<CommonMarkOptions>;
export default CommonMark;