codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 376 forks source link

Markdown: List not continued if the item ends with HTML #1462

Closed personalizedrefrigerator closed 2 weeks ago

personalizedrefrigerator commented 2 weeks ago

Describe the issue

Summary

With Markdown language support enabled, pressing enter at the end of a list item that ends with HTML does not continue the list.

To reproduce

  1. Create an editor with Markdown support.
  2. Start a checklist.
  3. Type an item that does not end with HTML.
  4. Press enter.
  5. Observe that a new list item is created.
  6. Type an item that does end with HTML.
  7. Press enter.
  8. Observe that a blank new line is created.

Screen recording

Screencast from 2024-11-05 16-26-49.webm

Browser and platform

Firefox 132.0, Linux/Ubuntu 24.04

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge21hcmtkb3dufSBmcm9tICJAY29kZW1pcnJvci9sYW5nLW1hcmtkb3duIgoKbGV0IHZpZXcgPSBuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiAnLSBbIF0gVGVzdGluZyFcbi0gWyBdIE1vdmUgdGhlIGN1cnNvciB0byB0aGUgZW5kIG9mIHRoaXMgbGluZSwgdGhlbiBwcmVzcyA8a2JkPmVudGVyPC9rYmQ+JywKICBleHRlbnNpb25zOiBbCiAgICBiYXNpY1NldHVwLAogICAgbWFya2Rvd24oKQogIF0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5Cn0pCg==

marijnh commented 2 weeks ago

Attached patch should help.

laurent22 commented 2 weeks ago

Thank you for fixing this so quickly @marijnh!