Please change the rules for pasting plain text

In prosemirror, if there is one newline, it is made into a paragraph.

If there is only one newline, then <br> If there are two line breaks, then <p></p>

However, I think I need to add some processing such as clipboardTextparser to do this. I am considering implementing clipboardTextparser myself if necessary, but if possible, I would like the official library to change the logic for inserting line breaks and paragraphs. If you don’t plan to change it, could you please tell me why the logic is like this?

I’m sorry for my bad English, and I’m new to this kind of community, so I apologize if I’m bothering you.

1 Like

This isn’t going to change in the core library—that would cause trouble for existing setups, and not everyone will consider your changes an improvement (there’s no guarantee that the pasted text will actually use the double-newline-for-paragraph-break convention).

So yes, you’ll have to implement a clipboardTextParser function yourself.

As a side comment: HTMLmirror vs ProseMirror:

Being an editor for HTML pages, I think what end users and developers want is a HTMLmirror editor instead of a ProseMirror editor (that focuses just on prose).

That is, a HTML editor that gives control over HTML content in a WYSIWYG way and can also handle pasting of complex HTML content (retaining the fidelity of the original HTML and then be able to edit it). That’s a lot to ask for … but that’s what users really want for HTML pages…

I just give this opinion to give input on your future direction for the project and especially the future scope of the project (prose vs more expansive HTML). ProseMirror is a great contribution and seems to be by far the leading editor for mobile browsers. Mobile is dominating the web, so ProseMirror is well positioned to be the basis of a powerhouse on the web…

Some situations do indeed need an HTML editor. They’ll want to use a different project because ProseMirror isn’t that editor.