Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

877 B
Raw Blame
import { TaskItem, TaskList } from '@tiptap/extension-list'
import StarterKit from '@tiptap/starter-kit'

import { LinkExtension } from 'lib/components/RichContentEditor/LinkExtension'

// Shared building blocks for the markdown editors (text card, AI prompt, etc). Each editor starts
// from these and only layers on what makes it different — images, a placeholder, tables, and so on.
const MARKDOWN_BASE_EXTENSIONS = [
    StarterKit.configure({
        heading: {
            levels: [1, 2, 3],
        },
        link: false,
    }),
    TaskList,
    TaskItem.configure({ nested: true }),
]

export const MARKDOWN_BASE_EDITABLE_EXTENSIONS = [
    ...MARKDOWN_BASE_EXTENSIONS,
    LinkExtension.configure({ openOnClick: false }),
]

export const MARKDOWN_BASE_READONLY_EXTENSIONS = [
    ...MARKDOWN_BASE_EXTENSIONS,
    LinkExtension.configure({ openOnClick: true }),
]