ProseMirror / prosemirror-markdown

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

allow empty string as firstDelim #87

Closed konstantinmuenster closed 2 years ago

konstantinmuenster commented 2 years ago

Hey!

Thanks for all the great work you put into Prosemirror!

We recently used prosemirror-markdown to transform our JSON content to Markdown. While doing that, we had the case that we wanted to render a list in which all items except the first had a delimiter.

This wasn't possible since passing in an empty string as firstDelim was considered falsy in firstDelim || delim.

I would like to propose changing it to firstDelim != null ? firstDelim : delim so that delim really only gets used if firstDelim is null or undefned.

marijnh commented 2 years ago

Looks reasonable, thanks.