Milkdown / milkdown

🍼 Plugin driven WYSIWYG markdown editor framework.
https://milkdown.dev
MIT License
8.64k stars 386 forks source link

[Bug] WSYWIG formatting with key shortcuts results in malformed markdown on export #1402

Closed Carefully-bound closed 1 month ago

Carefully-bound commented 1 month ago

Initial checklist

Affected packages and versions

core - 7.4.0

Link to runnable example

No response

Steps to reproduce

Reproduced both on Milkdown Playground and on a SvelteKit local app.

  1. Navigate to https://milkdown.dev/playground
  2. In the left panel, type anything.
  3. Press control + i
  4. Type test (be sure to end with a space)
  5. Press control + i again
  6. Type anything else.

Resulting text in the right panel will not be valid markdown, such as:

image

Expected behavior

For the example

normal italic text

Text should not have spaces between the markdown signal characters and the word, e.g., normal *italic* text

Actual behavior

For the example

normal italic text

Text has a trailing space before the markdown close character, e.g., normal *italic *text

Runtime

Chrome

OS

macOS

Build and bundle tools

Other (please specify in steps to reproduce)