ProseMirror / prosemirror-markdown

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

Editor removes line breaks when line starts with \ (backslash) #47

Closed nismangulov closed 3 years ago

nismangulov commented 4 years ago

Issue details

Editor removes line breaks when line starts with \ (backslash)

Steps to reproduce

  1. Open http://prosemirror.net/examples/markdown/
  2. Select markdown mode
  3. Type this text in textarea:
    **Text** line 1
    \- text line 2
    \- text line 3
    \- text line 4
    \- text line 5
    - text line 6
  4. Switch to WYSIWYM
  5. Try to edit text (e.g. try to add a space at line 2)
  6. Now editor removed all linebreak for lines, that starts with \

ProseMirror version

ProseMirror example at http://prosemirror.net/examples/markdown/ (as of 27th July 2020)

Affected platforms

Screenshots / Screencast (Optional)

Dt3M9Kf2yG

marijnh commented 4 years ago

I've moved this to prosemirror-markdown, as it looks like a serialization/deserialization issue, most likely around escaping. I'm unlikely to make time to work on this, but maybe someone else will take a look.

nismangulov commented 3 years ago

Fixed this bug.

Tokenizer markdown-it separates escaped bullet lists with soft_break node, which is not supported in the default configuration. Adding it to the config fixed the issue.

I think that I can close the issue now.