PHPackages                             ueberdosis/html-to-prosemirror - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ueberdosis/html-to-prosemirror

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

ueberdosis/html-to-prosemirror
==============================

Takes HTML and outputs ProseMirror compatible JSON.

1.5.0(5y ago)651.7M↓31.5%22[1 PRs](https://github.com/ueberdosis/html-to-prosemirror/pulls)1MITPHPPHP ^7.1.3|^8.0

Since Jan 16Pushed 4y ago3 watchersCompare

[ Source](https://github.com/ueberdosis/html-to-prosemirror)[ Packagist](https://packagist.org/packages/ueberdosis/html-to-prosemirror)[ GitHub Sponsors](https://github.com/sponsors/ueberdosis/)[ RSS](/packages/ueberdosis-html-to-prosemirror/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (27)Used By (1)

> 🚨 We’ve done a rewrite that you probably want to check out: [ueberdosis/tiptap-php](https://github.com/ueberdosis/tiptap-php)

HTML to ProseMirror
===================

[](#html-to-prosemirror)

[![](https://camo.githubusercontent.com/95991ac030fc40101671045abfb2010f11aa6e34d7091af83dd39c5598ec566b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7565626572646f7369732f68746d6c2d746f2d70726f73656d6972726f722e737667)](https://packagist.org/packages/ueberdosis/html-to-prosemirror)[![Integrate](https://github.com/ueberdosis/html-to-prosemirror/workflows/Integrate/badge.svg?branch=main)](https://github.com/ueberdosis/html-to-prosemirror/actions)[![](https://camo.githubusercontent.com/6db2e3d6e82f4a94d46a1fc5c6e7d6fdd0111140458a93396be7383d632807f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7565626572646f7369732f68746d6c2d746f2d70726f73656d6972726f722e737667)](https://packagist.org/packages/ueberdosis/html-to-prosemirror)[![Sponsor](https://camo.githubusercontent.com/ee73cad5907779cdf16e865239ea623ca0bd44ccd5ad44fa7bfe7a5ac3ced298/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d53706f6e736f72266d6573736167653d254532253944254134266c6f676f3d476974487562)](https://github.com/sponsors/ueberdosis)

Takes HTML and outputs ProseMirror compatible JSON.

Installation
------------

[](#installation)

```
composer require ueberdosis/html-to-prosemirror
```

Usage
-----

[](#usage)

```
(new \HtmlToProseMirror\Renderer)->render('Example Text')
```

Output
------

[](#output)

```
{
    "type": "doc",
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "Example Text"
                }
            ]
        }
    ]
}
```

Supported nodes
---------------

[](#supported-nodes)

- [Blockquote](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/Blockquote.php)
- [BulletList](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/BulletList.php)
- [CodeBlock](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/CodeBlock.php)
- [HardBreak](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/HardBreak.php)
- [Heading](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/Heading.php)
- [Image](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/Image.php)
- [ListItem](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/ListItem.php)
- [OrderedList](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/OrderedList.php)
- [Paragraph](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/Paragraph.php)
- [Table](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/Table.php)
- [TableCell](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/TableCell.php)
- [TableHeader](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/TableHeader.php)
- [TableRow](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/TableRow.php)
- [User](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Nodes/User.php)

Supported marks
---------------

[](#supported-marks)

- [Bold](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Bold.php)
- [Code](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Code.php)
- [Italic](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Italic.php)
- [Link](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Link.php)
- [Strike](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Strike.php)
- [Subscript](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Subscript.php)
- [Superscript](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Superscript.php)
- [Underline](https://github.com/ueberdosis/html-to-prosemirror/blob/main/src/Marks/Underline.php)

Custom nodes
------------

[](#custom-nodes)

Define your custom nodes as PHP classes:

```
