Integrating TinyMCE inside prosemirror

Hi, I have been working on prosemirror for a couple of years now, we have come up with a use case where we want to have prosemirror based document model for editing as well as some parts inside the prosemirror where we want to edit arbitrary HTML using editors like TinyMCE or Squire, etc. Say a typical example would be is to insert a template and edit the content inside it for mail composing cases.

So I was wondering has anyone come up with this use case and has anyone solved it before, if so could you share the approach that you have taken. I just want to know is this use case possible to achieve in prosemirror using node views or something like that or is it not at all possible.

Right now in top of my mind I have an approach where we can integrate TinyMCE inside prosemirror using node views just like how codemirror can be integrated inside prosemirror, would this approach work out or am I missing something?

This example, which uses a code editor for code blocks, might be a useful starting point.

Hey @Dhananjeyan286 , just a comment on TinyMCE and other editors as editors of “arbitrary HTML” - just FYI - none of them allow fully arbitrary HTML. That has to do with the way contenteditable is implemented in browsers that will make it close to impossible for editors to allow every possible combination of HTML and CSS.

@johanneswilm an editor like TinyMCE would satisfy the needs to compose email consisting of arbitrary HTML(probably to create some fancy invitations for some events or some reply templates consisting of fancy HTML for company’s branding purposes). So TinyMCE should fix this I guess.

Also TinyMCE has the same restrictions that all other browser-based text editors have. If you use an old version it may not have a white list of acceptable html tag but will then instead break in various uncontrollable ways.

Actually the aim is to allow most of the html tags without any grammar, but prosemirror does’nt allow to do so. Since prosemirror is a model based editor it focuses on ensuring that the grammar is followed so that editor will behave predictably, but what the customers here are asking is, we are ready to trade off the editing experience for junk html(here, arbitrary html) that comes in.

So what we are trying to architect is a mix of both, that is purely contenteditable based editor inside a model based editor, so the users who wants to trade-off the editing experience can use these blocks inside prosemirror, and the users who want a perfect editing experience can use prosemirror alone.