@mkljczk/lexical-remark
TypeScript icon, indicating that this package has built-in type declarations

0.3.9 • Public • Published

Lexical Remark

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

Usage

Lexical to Markdown

import { createRemarkExport } from 'lexical-remark';

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

Markdown to Lexical

import { createRemarkImport} from 'lexical-remark';

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

Package Sidebar

Install

npm i @mkljczk/lexical-remark

Weekly Downloads

0

Version

0.3.9

License

MIT

Unpacked Size

185 kB

Total Files

178

Last publish

Collaborators

  • mkljczk