There seems to be a bug in markdown mode

This is the code I introduced markdown and used

import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
new EditorView({
	state: EditorState.create({
		doc: '',
		extensions: [
				base: markdownLanguage
                        keymap.of([defaultTabBinding, ...defaultKeymap, ...historyKeymap, ...closeBracketsKeymap]),

The problems are as follows

When I enter “-” and enter the content, then enter. A new line will be generated and start with “-”. Then I press the delete key. It doesn’t seem to delete normally. After deleting, there will be an extra space. At the same time, I continue to enter content in the current line, and then press enter to bring the characters into the new line


Here is a dynamic example of GIF

There is another problem

If markdown mode is not used, you can press Shift + tab to indent forward. After using markdown mode, this function fails

Assuming you mean backspace when you say delete, that’s intentional (see the deleteMarkupBackward command which is bound by the Markdown keymap).

Shift-Tab auto-indents the selection, so it doesn’t fail, it just doesn’t change indentation.

After writing to the list, start a new line, enter content, and then press enter. By default, the first two characters are brought to the new line. What’s the problem

That was already fixed in git. I’ve released @codemirror/lang-markdown 0.18.2 with the fix.

1 Like

Well, thank you very much.