ProseMirror / prosemirror-markdown

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

Expel trailing or leading whitespace from inside emphasis marks #6

Closed eloquence closed 7 years ago

eloquence commented 7 years ago

Per CommonMark (and the markdown-it implementation), syntax like * foo * is not valid for emphasis. So when we encounter nodes like <em> foo </em>, we now serialize them to *foo*.

Fixes #1

eloquence commented 7 years ago

Hi! I've tested this locally and also added a new test for this behavior. Please let me know if this approach has obvious unwanted side effects that I'm overlooking, or if the implementation is otherwise not desirable. Happy to follow-up and amend as needed.

marijnh commented 7 years ago

Great solution. Thanks for taking care of that. Merged!