Skip to content

Implementing a ProseMirror Remark plugin - How to work with non-unist, non-string inputs? #254

You must be logged in to vote

This doesn't really seem to align with unified's processing model, though

Unified has several different approaches to being used.
You appear to be referring mostly to the programmatic Node/JS API.
The string requirement comes in because it also has a CLI that expects to be able to read a file.

https://unifiedjs.com/learn/


It seems like the move here is to produce a unist-compatible ProseMirror syntax-tree, convert the ProseMirror doc to that tree, and then processor.run on the tree to convert it to mdast and stringify to Markdown.

Exactly
I'd recommend creating an mdast util, there may be some inspiration to draw from a now deprecated quill connector https://github.com/syntax-tree/md…

Replies: 1 comment 10 replies

You must be logged in to vote
10 replies
@ChristianMurphy

@smoores-dev

@smoores-dev

@ChristianMurphy

@wooorm

Answer selected by smoores-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants