Skip to content

Conversation

@seiyab
Copy link
Collaborator

@seiyab seiyab commented Jan 27, 2024

Description

First step of #15909.
Narrowing the scope of normalizeDoc() that yields invalid fill(), this PR

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@seiyab seiyab changed the title 9503 narrow normalize doc scope Improve wrapping for codeblock in markdown and jsx in mdx Jan 27, 2024
@seiyab seiyab force-pushed the 9503-narrow-normalizeDoc-scope branch from 346099b to 8d4f77c Compare January 28, 2024 00:06
@seiyab seiyab marked this pull request as ready for review January 28, 2024 00:09
@seiyab seiyab mentioned this pull request Jan 28, 2024
4 tasks
@fisker
Copy link
Member

fisker commented Jan 28, 2024

I totally forgot #9847... I'll take a deeper look soon.

@fisker
Copy link
Member

fisker commented Feb 3, 2024

Calling cleanDoc on root seems useless, removed and tests still pass bee898a

@fisker
Copy link
Member

fisker commented Feb 3, 2024

@seiyab I tried to copy flattenFill from #15993 into this one, but the result is different, so the bug part is fixed by building other parts differently?

@fisker
Copy link
Member

fisker commented Feb 3, 2024

From what I can see is that we fix these test cases by removing the normalizeDoc call on root.
The result looks great!

@fisker fisker requested a review from sosukesuzuki February 3, 2024 18:31
@fisker
Copy link
Member

fisker commented Feb 3, 2024

Took another look at #9847, these two PRs are doing the samething 😄 We'll address #9847 (comment) in #15909.

@seiyab
Copy link
Collaborator Author

seiyab commented Feb 3, 2024

@fisker
To fix word wrapping in paragraph, just flattenFill() is not sufficient. flattenFill() requires internal fill()s to be valid form but some fill()s like sentence yield invalid ones. seiyab@842f0b5 should result same as #15909.
Does this answer #15993 (comment) well?

@seiyab
Copy link
Collaborator Author

seiyab commented Feb 4, 2024

I resolve conflict with #16032.

@seiyab
Copy link
Collaborator Author

seiyab commented Mar 19, 2024

@sosukesuzuki
Don't you miss this PR?
There's no hurry. Just worrying that it's forgotten.

Copy link
Contributor

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this

@sosukesuzuki sosukesuzuki merged commit d970dee into prettier:main Mar 20, 2024
@seiyab seiyab deleted the 9503-narrow-normalizeDoc-scope branch March 20, 2024 08:12
@fisker fisker mentioned this pull request May 28, 2024
4 tasks
@kachkaev kachkaev added this to the 3.3 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline React components in MDX cause line lengths to exceed print-width

4 participants