Closed VV-EE closed 3 years ago
#
can be safely escaped in Markdown, so I think the current behavior is acceptable. There's no guarantee that text round-trips through the conversion without changing—only its meaning shouldn't change, the actual characters will change. I can also imagine people defining custom syntax (such as hashtag syntax) that acts on unescaped #
characters, so escaping them seems useful and I don't really want to further complicate that.
Sounds reasonable, thanks for the reply!
@heyakyra No, Marijn is right. One of my clients still needed this, it's hosted at https://github.com/VV-EE/prosemirror-markdown
The issue was that the escape function escaped hashtags even when it wasn't followed by whitespace. In that case the # should not be escaped since for ex. #myhashtag is not a header ( there has to be a whitespace according to the markdown spec ). This caused an issue when doing markdown->prosemirror->markdown conversion #myhashtag became /#myhashtag, I think the conversion to and back should should not change anything.
Illustrations
Original markdown editor: After WYSIWYG conversion: Back to markdown: