# rich-editor-to-markdown-parser

> Rich Editor response convert to markdown.

Latest version **1.2.0** (published 2024-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install rich-editor-to-markdown-parser
pnpm add rich-editor-to-markdown-parser
yarn add rich-editor-to-markdown-parser
bun add rich-editor-to-markdown-parser
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2024-08-25 |
| First published | 2023-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 56.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hiro08 |
| Maintainers | hiro08 |
| Keywords | markdown, microCMS |

## Links

- npm: https://www.npmjs.com/package/rich-editor-to-markdown-parser
- npm.io page: https://npm.io/package/rich-editor-to-markdown-parser

## Dependencies (1)

- [html-dom-parser](https://npm.io/package/html-dom-parser.md) ^5.0.4

## 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

- 1.2.0 (latest) — 2024-08-25
- 1.1.1 — 2023-12-25
- 1.1.0 — 2023-12-17
- 1.0.0 — 2023-12-10
- 0.0.5 — 2023-12-09
- 0.0.3 — 2023-12-08
- 0.0.2 — 2023-12-08
- 0.0.1 — 2023-12-08

## README

# rich-editor-to-markdown-parser

Convert microCMS Rich Editor response to Markdown.

<img width="1326" alt="スクリーンショット 0005-12-09 14 26 25" src="https://github.com/hiro08gh/rich-editor-to-markdown-parser/assets/39504660/68c9397f-1c80-45fa-97be-ca3fdc1e46ef">

## Installation

```
npm install rich-editor-to-markdown-parser
```

## Usage

```js
import { parser } from 'rich-editor-to-markdown-parser';
// If you are importing multiple items with the same name parser, please assign an alias to them.
import { parser as RichEditorToMarkddownParser } from 'rich-editor-to-markdown-parser';

const html = '<h1>Hello World!</h1><p>This <strong>html</strong> string is <s>convert</s>into <a href="https://exampe.com">markdown.</a></p>'

parser(html); // # Hello World!\n\nThis **html** string is ~~convert~~ into [markdown.](https://exampe.com)
```

※ Unsupported HTML tags are parsed as strings. When converting markdown to HTML, consider sanitizing it using [DOMPurify](https://github.com/cure53/DOMPurify) or [sanitize-html](https://github.com/apostrophecms/sanitize-html).
## HTML list

| HTML | Description |
| --- | --- |
| Heading |  |
| Bold |  |
| Italic |  |
| Underline | Parsed with HTML tags |
| Strike |  |
| Code |  |
| TextAlign | Not supported |
| Horizontal Rule |  |
| Blockquote |  |
| CodeBlock |  |
| Table |  |
| ListBullet |  |
| ListOrdered |  |
| Link |  |
| Image |  |
| Embed | Not supported |
| Custom class | Parsed with HTML tags |

## Options

| Option | Description | Defualt |
| --- | --- | --- |
| image.size | Contain width and height image size. ex) ?w=1200&h=630 | true |
| image.query | Add image query in markdown. ex) ?format=webp | '' |
| markStyle.strong | ** or __ | ** |
| markStyle.em | *  or _ | * |
| markStyle.li | - or * or + | - |
| markStyle.hr | --- or *** or ___ | --- |
| markStyle.pre | ``` or ~~~ | ``` |

---
_Source: https://npm.io/package/rich-editor-to-markdown-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
