[lexical-markdown] Feature Change: Dont trim whitespaces on convertFromMarkdownString #6360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Issue #6325 is about inconsistent conversion regarding whitespace trim.
markdown -> string: does not trim whitespace
string -> markdown: trims whitespace
the whitespace trim was introduced in #2519 , which has a bunch of other markdown improvements.
One goal listed in PR2519 is to make markdown a bit closer to commonmark spec. checking commonmark, it doesnt trim whitespaces on string -> markdown conversion. same behavior for markdown on github. so i guess, it would be more commonmark-ish to not trim whitspaces.
hi @fantactuka ! May i check with you if theres any dangers to not trim whitespaces?
Closes #6325
Test plan
Before
Screen.Recording.2024-07-01.at.7.59.45.PM.mov
string -> markdown: trims whitespace
After
Screen.Recording.2024-07-01.at.7.59.34.PM.mov
string -> markdown: does not trim whitespace
npm run start & npm run test-e2e-chromium
no failing tests