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

Fix formatting of incomplete CSS value comments #16583

Merged
merged 7 commits into from
Oct 10, 2024

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Aug 18, 2024

Description

Fixes #15948

This is a non-ideal workaround, because it's a parser bug.

Checklist

  • I’ve added tests to confirm my change works.
  • (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

@sosukesuzuki sosukesuzuki marked this pull request as ready for review August 18, 2024 01:35
@fisker fisker self-requested a review August 18, 2024 03:47
@fisker
Copy link
Member

fisker commented Aug 23, 2024

This doesn't fix the problem,

Prettier pr-16583
Playground link

--parser css

Input:

h1 {
  --OFF:  /* OFF */;
  --OFF:   /* OFF */;
  --OFF:    /* OFF */;
  --OFF:     /* OFF */;
  --OFF:      /* OFF */;
  --OFF:       /* OFF */;
}

Output:

h1 {
  --OFF: /*  /* OFF * */;
  --OFF: /*   /* OFF  */;
  --OFF: /*    /* OFF */;
  --OFF: /*     /* OF */;
  --OFF: /*      /* O */;
  --OFF: /*       /*  */;
}

@fisker
Copy link
Member

fisker commented Aug 23, 2024

I'll take a look.

--OFF: /* OFF */;
--OFF: /* OFF */;
--OFF: /* OFF */;
--OFF: /* OFF */;
Copy link
Member

Choose a reason for hiding this comment

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

I can't find specs for how this should work, not sure if it can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

@alexander-akait Maybe you know about it?

@fisker
Copy link
Member

fisker commented Oct 8, 2024

@sosukesuzuki Can you take a look?

Copy link
Member Author

@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.

This is my PR so I cannot approve it on GitHub, but LGTM.

@fisker fisker merged commit 973f3b5 into prettier:main Oct 10, 2024
28 checks passed
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.

[css]: custom property with comment breaks
2 participants