ProseMirror / prosemirror

The ProseMirror WYSIWYM editor

Home Page:http://prosemirror.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make content parts readonly

dmtrrk opened this issue · comments

I have a text in the editor. I want to make parts of the text read-only so the user can not delete or modify them (with additional visual highlighting of such parts).
Ideally, I want to make such read-only content collapsible so it is possible to minimize the visibility of the text that can not be modified, but the user can expand it to see the surrounding text if needed.

Wondering if there is a best practice or example of the creation of a similar functionality

The forum is the place for things that are not bug reports.

You can use plugins with filterTransaction hooks to prevent certain kinds of edits. Making something collapsible could be done with a node view or a plugin that somehow shows controls and uses decorations to hide content.