Skip to content

Fix formatting of incomplete CSS value comments#16583

Merged
fisker merged 7 commits intoprettier:mainfrom
sosukesuzuki:fix-15948
Oct 10, 2024
Merged

Fix formatting of incomplete CSS value comments#16583
fisker merged 7 commits intoprettier:mainfrom
sosukesuzuki:fix-15948

Conversation

@sosukesuzuki
Copy link
Contributor

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