kelvinleehk

payload paste as markdown

by kelvinleehk
Rich text & editors
v3
^3.0.0
MIT

Overview

Summary generated from the README

A client-side Lexical feature for Payload 3.x that lets authors paste raw Markdown into the rich-text editor. It is added to the features array of lexicalEditor rather than to the top-level plugins list. The Markdown is converted with Lexical's markdown transformers and inserted at the cursor. It requires regenerating the import map and React 19.

Features

  • Toolbar button in both fixed and inline toolbars
  • Slash menu item reachable via markdown, md, or paste
  • Modal drawer with a monospace textarea for Markdown input
  • Inserts converted content at the cursor, splitting the current paragraph if needed
  • Pure client feature with no backend code

Use cases

  • Move drafted Markdown from documentation or AI tools into Lexical fields
  • Let editors who prefer Markdown add formatted content without manual reformatting

From the author

Payload CMS Lexical editor feature for pasting Markdown via a toolbar button, slash command, or drawer.

Installation

npm i payload-paste-as-markdown

0

Stars

0

Forks

0

Open Issues

3 months ago

Last Updated

996

Weekly Downloads

v0.1.2

npm Version

20.0 KB

Unpacked Size

0

Dependencies

GitHub stars

00 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20260
Dec 4, 20260
Dec 3, 20260
Dec 2, 20260
Dec 1, 20260
Nov 30, 20260
Nov 29, 20260
Nov 28, 20260
Nov 27, 20260
Nov 26, 20260
Nov 25, 20260
Nov 24, 20260
Nov 23, 20260
Nov 22, 20260
Nov 21, 20260
Nov 20, 20260
Nov 19, 20260
Nov 18, 20260
Nov 17, 20260
Nov 16, 20260
Nov 15, 20260
Nov 14, 20260
Nov 13, 20260
Nov 12, 20260
Nov 11, 20260
Nov 10, 20260
Nov 9, 20260
Nov 8, 20260
Nov 7, 20260
Nov 6, 20260
Nov 5, 20260
Nov 4, 20260
Nov 3, 20260
Nov 2, 20260
Nov 1, 20260
Oct 31, 20260
Oct 30, 20260
Oct 29, 20260
Oct 28, 20260
Oct 27, 20260
Oct 26, 20260
Oct 25, 20260
Oct 24, 20260
Oct 23, 20260
Oct 22, 20260
Oct 21, 20260
Oct 20, 20260
Oct 19, 20260
Oct 18, 20260
Oct 17, 20260
Oct 16, 20260
Oct 15, 20260
Oct 14, 20260
Oct 13, 20260
Oct 12, 20260
Oct 11, 20260
Oct 10, 20260
Oct 9, 20260
Oct 8, 20260
Oct 7, 20260
Oct 6, 20260
Oct 5, 20260
Oct 4, 20260
Oct 3, 20260
Oct 2, 20260
Oct 1, 20260
Sep 30, 20260
Sep 29, 20260
Sep 28, 20260
Sep 27, 20260
Sep 26, 20260
Sep 25, 20260
Sep 24, 20260
Sep 23, 20260
Sep 22, 20260
Sep 21, 20260
Sep 20, 20260
Sep 19, 20260
Sep 18, 20260
Sep 17, 20260
Sep 16, 20260
Sep 15, 20260
Sep 14, 20260
Sep 13, 20260
Sep 12, 20260
Sep 11, 20260
Sep 10, 20260
Sep 9, 20260
Sep 8, 20260
Sep 7, 20260
Sep 6, 20260
npm weekly downloads

835+796 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 2026835
Dec 4, 2026528
Dec 3, 2026431
Dec 2, 2026240
Dec 1, 2026162
Nov 30, 202656
Nov 29, 202611
Nov 28, 202611
Nov 27, 202611
Nov 26, 202611
Nov 25, 20266
Nov 24, 20264
Nov 23, 20264
Nov 22, 20265
Nov 21, 20267
Nov 20, 20267
Nov 19, 20267
Nov 18, 20268
Nov 17, 20268
Nov 16, 20269
Nov 15, 20269
Nov 14, 202611
Nov 13, 202613
Nov 12, 202613
Nov 11, 202617
Nov 10, 202617
Nov 9, 202616
Nov 8, 202615
Nov 7, 202614
Nov 6, 202611
Nov 5, 202610
Nov 4, 20265
Nov 3, 20266
Nov 2, 20269
Nov 1, 202610
Oct 31, 202613
Oct 30, 202613
Oct 29, 202612
Oct 28, 202612
Oct 27, 202612
Oct 26, 202616
Oct 25, 202616
Oct 24, 202617
Oct 23, 202617
Oct 22, 202619
Oct 21, 202620
Oct 20, 202619
Oct 19, 202614
Oct 18, 202619
Oct 17, 202613
Oct 16, 202613
Oct 15, 202615
Oct 14, 202614
Oct 13, 202615
Oct 12, 202615
Oct 11, 202610
Oct 10, 202615
Oct 9, 202615
Oct 8, 202612
Oct 7, 202613
Oct 6, 202614
Oct 5, 202614
Oct 4, 202616
Oct 3, 202614
Oct 2, 202618
Oct 1, 202617
Sep 30, 202620
Sep 29, 202626
Sep 28, 202628
Sep 27, 202637
Sep 26, 202653
Sep 25, 202658
Sep 24, 202663
Sep 23, 202666
Sep 22, 202661
Sep 21, 202658
Sep 20, 202646
Sep 19, 202629
Sep 18, 202621
Sep 17, 202618
Sep 16, 202614
Sep 15, 202613
Sep 14, 202614
Sep 13, 202615
Sep 12, 202613
Sep 11, 202614
Sep 10, 202625
Sep 9, 202625
Sep 8, 202627
Sep 7, 202631
Sep 6, 202639

Each point is npm's rolling 7-day download count.

Health Score

63/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1346243759-root.svg)](https://payloaddirectory.dev/plugins/1346243759-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1346243759-root"><img src="https://payloaddirectory.dev/badge/1346243759-root.svg" alt="Payload Directory"></a>
Updated Aug 26, 2026Created Aug 25, 2026Published Aug 25, 2026

README

payload-paste-as-markdown

Screenshot of Paste-As-Markdown

A reusable Payload CMS 3.x Lexical editor feature that lets authors paste raw Markdown into the rich-text editor via a toolbar button, slash command, or keyboard-free drawer.

Compatibility

  • Payload CMS: 3.x only. This package is not compatible with Payload 2.x.
  • React: 19.x (via peer dependencies).

If you're browsing this repository on GitHub, please tag it with the payload-plugin topic so it surfaces in Payload community plugin listings.

This is a Lexical editor feature rather than a top-level buildConfig plugin, so it is configured inside lexicalEditor({ features: [...] }).

Features

  • Toolbar button in both fixed and inline toolbars
  • Slash-menu item (/markdown, /md, /paste)
  • Modal drawer with a monospace textarea for raw Markdown input
  • Inserts converted Markdown at the exact cursor position, splitting the current paragraph when needed
  • Zero backend code — it is a pure client Lexical feature

Installation

npm install payload-paste-as-markdown
# or
pnpm add payload-paste-as-markdown
# or
yarn add payload-paste-as-markdown

This package expects payload, @payloadcms/richtext-lexical, @payloadcms/ui, react, and react-dom to already be installed in your project.

Usage

Import the server feature and add it to the features array of any lexicalEditor:

import { MarkdownPasteFeature } from 'payload-paste-as-markdown'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import type { CollectionConfig } from 'payload'

export const Posts: CollectionConfig = {
  slug: 'posts',
  fields: [
    {
      name: 'content',
      type: 'richText',
      editor: lexicalEditor({
        features: ({ defaultFeatures }) => [
          ...defaultFeatures,
          MarkdownPasteFeature(),
        ],
      }),
    },
  ],
}

After installing, regenerate Payload's import map:

npx payload generate:importmap

How it works

  1. The server feature registers a client feature string that Payload resolves through the import map.
  2. The client feature adds a toolbar button, slash-menu group, and a plugin.
  3. The plugin opens a React-portal drawer when the command is dispatched.
  4. When the author confirms, the raw Markdown is converted using Lexical's markdown transformers and inserted at the original cursor position.

Peer dependencies

  • payload ^3.0.0
  • @payloadcms/richtext-lexical ^3.0.0
  • @payloadcms/ui ^3.0.0
  • react ^19.0.0
  • react-dom ^19.0.0

License

MIT Sponsored by: Onion Creative

Similar plugins