ProseMirror / prosemirror-markdown

ProseMirror Markdown integration
https://prosemirror.net
MIT License
345 stars 81 forks source link

Wrong argument type #33

Closed ocavue closed 5 years ago

ocavue commented 5 years ago

Base on the document, Node.copy() method should accept a Fragment object, but maybeMerge gives it a string.

https://github.com/ProseMirror/prosemirror-markdown/blob/6e9b03a59d3df714296ef6ee87322f5bc996ad33/src/from_markdown.js#L5-L8

ocavue commented 5 years ago

@marijnh

Thanks for your quick fix 😍.

I noticed that TextNode.withText(), as well as TextNode itself, are undocumented: they have no comments so that I can't find them in https://prosemirror.net/docs/ref.

Should I use these classes or methods in my own project? More specifically, does these undocumented API has the same backward compatibility as those documented API?

marijnh commented 5 years ago

does these undocumented API has the same backward compatibility as those documented API?

No, and actually it's kind of bad style that I used them from another package (though it seems there was already an occurrence in the markdown package). I guess it would be cleaner to just change this to a call to schema.text.