# lexical-remark

> This package contains Markdown helpers and functionality for Lexical using remark-parse.

Latest version **0.3.9** (published 2025-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install lexical-remark
pnpm add lexical-remark
yarn add lexical-remark
bun add lexical-remark
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2025-05-22 |
| First published | 2023-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 180.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | themagickoala |
| Keywords | lexical, editor, rich-text, markdown, remark, remark-parse |

## Links

- npm: https://www.npmjs.com/package/lexical-remark
- npm.io page: https://npm.io/package/lexical-remark

## Dependencies (8)

- [eslint](https://npm.io/package/eslint.md) ^8.41.0
- [zwitch](https://npm.io/package/zwitch.md) ^2.0.4
- [unified](https://npm.io/package/unified.md) ^10.1.2
- [remark-parse](https://npm.io/package/remark-parse.md) ^10.0.1
- [remark-stringify](https://npm.io/package/remark-stringify.md) ^10.0.2
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^4.1.2
- [mdast-util-from-markdown](https://npm.io/package/mdast-util-from-markdown.md) ^1.3.0
- [@nexusmods/eslint-plugin-nexusmods](https://npm.io/package/@nexusmods/eslint-plugin-nexusmods.md) ^0.0.6

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.3.9 (latest) — 2025-05-22
- 0.3.8 — 2023-07-11
- 0.3.7 — 2023-07-11
- 0.3.6 — 2023-07-11
- 0.3.5 — 2023-06-21
- 0.3.4 — 2023-06-20
- 0.3.3 — 2023-06-20
- 0.3.2 — 2023-06-20
- 0.3.1 — 2023-06-19
- 0.3.0 — 2023-06-15
- 0.2.5 — 2023-06-13
- 0.2.4 — 2023-06-13
- 0.2.3 — 2023-06-13
- 0.2.2 — 2023-06-13
- 0.2.1 — 2023-06-12
- … 46 more at https://npm.io/package/lexical-remark/versions

## README

# Lexical Remark

First attempt at integrating the remark ecosystem with lexical to perform markdown conversion.

## Usage

### Lexical to Markdown

```typescript
import { createRemarkExport } from 'lexical-remark';

function exportLexicalToMarkdown(editor: LexicalEditor): string {
  return editor.getEditorState().read(createRemarkExport());
}
```

### Markdown to Lexical

```typescript
import { createRemarkImport} from 'lexical-remark';

function importMarkdownToLexical(editor: LexicalEditor, markdown: string): void {
  editor.update(
      () => createRemarkImport()(markdown),
      {
        discrete: true,
      },
  );
}
```

---
_Source: https://npm.io/package/lexical-remark · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
