Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-markdown] Feature Change: Dont trim whitespaces on convertFromMarkdownString #6360

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

potatowagon
Copy link
Contributor

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.

Screenshot 2024-07-01 at 7 55 10 PM

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

Copy link

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 0:01am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2024 0:01am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 1, 2024
Copy link

github-actions bot commented Jul 1, 2024

size-limit report 📦

Path Size
lexical - cjs 28.47 KB (0%)
lexical - esm 28.28 KB (0%)
@lexical/rich-text - cjs 36.86 KB (0%)
@lexical/rich-text - esm 28.08 KB (0%)
@lexical/plain-text - cjs 35.49 KB (0%)
@lexical/plain-text - esm 25.3 KB (0%)
@lexical/react - cjs 38.82 KB (0%)
@lexical/react - esm 29.27 KB (0%)

@fantactuka
Copy link
Contributor

fantactuka commented Jul 1, 2024

any dangers to not trim whitespaces

Can't recall specific reasons, so as long as tests are passing and we're closer to spec it should be good to go. I'd double check WP Composer once sync'd with www

@potatowagon potatowagon added this pull request to the merge queue Jul 2, 2024
Merged via the queue into main with commit 131feee Jul 2, 2024
34 of 39 checks passed
@potatowagon
Copy link
Contributor Author

tests failures unrelated, due to flaky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: $convertFromMarkdownString followed by $convertToMarkdownString yields different markdown.
3 participants