Closed rkok closed 1 month ago
This was fixed by your PR I believe. Thank you for the contribution.
I am using the latest version of 3.15.0
but it's new lines are trimmed
https://github.com/user-attachments/assets/b91c04da-d75d-4b6e-9214-8829ef71e201
Fixed by PR: https://github.com/mdx-editor/editor/pull/597
Describe the bug When starting with markdown that can be trimmed, e.g. markdown containing newlines at the end,
MDXEditor will trim it before showing the editor.
When MDXEditor is passed
diffSourcePlugin({viewMode: 'source'})
, this triggers an unwantedonChange
event on startup.Reproduction https://codesandbox.io/p/sandbox/mdx-editor-base-forked-gqzjfz?file=%2Fsrc%2FApp.tsx%3A33%2C28&workspaceId=1e986154-c9ba-40cd-8a6f-4c674cdf70c8
To Reproduce Initialize with markdown that contains trailing newlines.
Expected behavior The editor keeps the trailing newlines.
Actual behavior Trailing newlines are trimmed.