All Projects → ueberdosis → html-to-prosemirror

ueberdosis / html-to-prosemirror

Licence: MIT License
Takes HTML and outputs ProseMirror compatible JSON.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to html-to-prosemirror

prosemirror-autocomplete
Autocomplete suggestions for ProseMirror
Stars: ✭ 23 (-65.15%)
Mutual labels:  prosemirror
schema
Typed schema for writing reactive scientific documents.
Stars: ✭ 17 (-74.24%)
Mutual labels:  prosemirror
prosemirror-react-typescript-example
Minimal boilerplate to start a project with ProseMirror, React, TypeScript
Stars: ✭ 67 (+1.52%)
Mutual labels:  prosemirror
prosemirror-dev-toolkit
Injectable developer tools for ProseMirror rich-text editors implemented in Svelte and TypeScript.
Stars: ✭ 44 (-33.33%)
Mutual labels:  prosemirror
editor
An interactive scientific editor built with ProseMirror, React and Redux - by Curvenote.
Stars: ✭ 157 (+137.88%)
Mutual labels:  prosemirror
bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io
Stars: ✭ 541 (+719.7%)
Mutual labels:  prosemirror
ed
Text editing with media widgets
Stars: ✭ 56 (-15.15%)
Mutual labels:  prosemirror
noteworthy
Markdown editor with bidirectional links and excellent math support, powered by ProseMirror. (In Development!)
Stars: ✭ 178 (+169.7%)
Mutual labels:  prosemirror
awesome-tiptap
⚡ Delightful Tiptap packages and resources
Stars: ✭ 55 (-16.67%)
Mutual labels:  prosemirror
wax-prosemirror
A rich-text editor using Prosemirror with React
Stars: ✭ 31 (-53.03%)
Mutual labels:  prosemirror
Rich Markdown Editor
The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
Stars: ✭ 2,468 (+3639.39%)
Mutual labels:  prosemirror
Tiptap
The headless editor framework for web artisans.
Stars: ✭ 13,629 (+20550%)
Mutual labels:  prosemirror
fiber-note
A networked note-taking app, open and self-hosted, inspired by roam-research, obsidian and others.
Stars: ✭ 146 (+121.21%)
Mutual labels:  prosemirror

🚨 We’ve done a rewrite that you probably want to check out: ueberdosis/tiptap-php

HTML to ProseMirror

Integrate Sponsor

Takes HTML and outputs ProseMirror compatible JSON.

Installation

composer require ueberdosis/html-to-prosemirror

Usage

(new \HtmlToProseMirror\Renderer)->render('<p>Example Text</p>')

Output

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

Supported nodes

Supported marks

Custom nodes

Define your custom nodes as PHP classes:

<?php

class CustomNode extends \HtmlToProseMirror\Nodes\Node
{
    protected $markType = 'custom';
    protected $tagName = 'marquee';
}

And register them:

$renderer->addNode(CustomNode::class);

Or overwrite the enabled nodes:

$renderer->withNodes([
    CustomNode::class,
]);

Or overwrite the enabled marks:

$renderer->withMarks([
    Bold::class,
]);

Or replace just one mark or node:

$renderer->replaceNode(
    CodeBlock::class, CustomCodeBlock::class
);

$renderer->replaceMark(
    Bold::class, CustomBold::class
);

Contributing

Pull Requests are welcome.

Credits

Related packages

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].