transformPasted, as the types show, works in terms of ProseMirror slices, so I’m not sure what you want to do with a Markdown parser there. Maybe you’re looking for transformPastedText instead?
I might misunderstand the functions intent but transformPastedText seems to be applied only to text/plain content type (resp. for transformPastedHTML and text/html)?
Edit: I confirm those are for string manipulation but not for creating nodes from the pasted content.
This is the first step of implementing some more advanced parsing logic during paste/drop, so I used the more generating transformPasted.
My goal is to detect markdown syntax in the pasted/dropped text and turn it into the right prosemirror nodes
I now get the slice content with slice.content.textBetween(0, slice.size) but the final slice still seems wrong and no text is added on paste.
This will create a slice holding a top-level document node, which as such cannot be inserted anywhere. new Slice(parsed.content, 0, 0) is probably closer to what you want.
The parse.content part (instead of manually creating a Fragment) is better indeed, the log show the right content for the slice, with markdown marks being parsed:
But the slice still doesn’t display with new Slice(parsed.content, 0, 0).
I’ve tried 0,0 and slice.openStart, slice.openEnd, same result. I didn’t really figure what they mean so my issue is probably there.