fix: always adding new line in code block #90

Merged
duongtn811 merged 1 commit from fix/code-block-ends-with-new-line into master 2023-03-20 11:28:01 +01:00
duongtn811 commented 2023-03-18 16:12:10 +01:00 (Migrated from github.com)

If a code block ends with an empty line, a new line will not be added to the state
https://github.com/ProseMirror/prosemirror-markdown/blob/master/src/to_markdown.ts#L74

But when parsing markdown, the new line will be removed
https://github.com/ProseMirror/prosemirror-markdown/blob/master/src/from_markdown.ts#L116

This causes the issue that content before and after parsing will be different

Example:

Line 1

Current version

Line 1

After new change

Line 1

If a code block ends with an empty line, a new line will not be added to the state https://github.com/ProseMirror/prosemirror-markdown/blob/master/src/to_markdown.ts#L74 But when parsing markdown, the new line will be removed https://github.com/ProseMirror/prosemirror-markdown/blob/master/src/from_markdown.ts#L116 This causes the issue that content before and after parsing will be different Example: ``` Line 1 ``` **Current version** ``` Line 1 ``` **After new change** ``` Line 1 ```
marijnh commented 2023-03-20 11:28:06 +01:00 (Migrated from github.com)

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-markdown!90
No description provided.