Would it be possible to have content inside curly braces collapse to some kind of icon?

Hello. I’m a total newbee regargind ProseMirror and very confused about it’s role when dealing with DSL, parsers and AST. One example would be the use of curly braces to enclose metadata in markdown that would be collapsed visually. Could ProseMirror model deal with this, would it need some kind of external parser? Another example would be it’s use in a markdown like language I recently found, Argdown

I guess I would like to understand the relationship between ProseMirror and parsers… Can someone help me figure this out? Any resources I should read?


ProseMirror has no relation to parsers at all, really. There’s utilities like prosemirror-markdown to convert Markdown notation to and from ProseMirror documents, but the editor itself does not do any parsing of content text.

Hi. Thanks for the response Marijn. And great work by the way. I’ve enjoyed using CodeMirror in the past a lot. Just to be sure, and pardon my complete ignorance… Would it be possible to have any curly braced enclosed text be a node that would have a special collapsible dom container? What I’m trying to achieve is having semantic data added to parts of the document by simply writing it in this manner. Any advice on how this could be achieved? Thanks again

You could try to define an input rule that wraps text in a given node when you type curly braces, but before you get anywhere you’re probably going to have to read some docs to understand what the library does, and how.

Hi! Yes, I definitely did not dive too deep into the docs (although I went once through the main documentation I didn’t do any coding yet) So I take it that ProseMirror should be flexible and powerful enough, in the hands of someone knowledgeable of course, to achieve this type of complex behavior if proper communication between a DSL parser is made. Does it have any kind of limitation that could be easily described in technical terms for someone in the parsing/DSL design area? Thanks again… and hope I have the courage to do a deep dive into it. By the way, should I stay away from react wrappers like remirror if I ever go for the deep dive or does it limit access to useful functionality? Thanks again