Skip to content

Fixes #5014 by avoiding adding whitespace and line breaks to urls - #8392

Closed
robert-j-webb wants to merge 1 commit into
prettier:masterfrom
robert-j-webb:pull3
Closed

robert-j-webb wants to merge 1 commit into
prettier:masterfrom
robert-j-webb:pull3

Conversation

@robert-j-webb

@robert-j-webb robert-j-webb commented May 24, 2020 •

Copy link
Copy Markdown
Contributor

Spent the whole day on this. Really nasty problem. Happy to make any changes to it.

Unfortunately: I can't distinguish between: url(fbglyph:cross-outline , fig-white); and url(url.com/Prettier+Sans&size=500,400,300,1000,600);

However the fbglygh: syntax isn't really supported by CSS, and this change means that prettier won't break stylesheets.

Fixed an issue where prettier mangled CSS urls that were unqoted and had commas or addition signs in them.

  • 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/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

✨Try the playground for this PR✨

@thorn0 thorn0 linked an issue May 25, 2020 that may be closed by this pull request
@fisker

fisker commented May 25, 2020

Copy link
Copy Markdown
Member

I wrote this?

@alexander-akait

Copy link
Copy Markdown
Member

@fisker it is not ideal solution, but better than we have right now

@fisker

fisker commented May 25, 2020

Copy link
Copy Markdown
Member

I know, but the commit shows I wrote it? I don't remeber. 😄

@robert-j-webb

robert-j-webb commented May 25, 2020 •

Copy link
Copy Markdown
Contributor Author

I wrote this?

I have no idea why your name is on this commit, I may have made a mistake while amending it or something? Sorry!

I changed it to my name.

…urls

Spent the whole day on this. Really nasty problem. Happy to make any changes to it.

Unfortunately: I can't distinguish between: url(fbglyph:cross-outline , fig-white); and url(url.com/Prettier+Sans&size=500,400,300,1000,600);

However the fbglygh: syntax isn't really supported by CSS, and this change means that prettier won't break stylesheets.
@robert-j-webb

Copy link
Copy Markdown
Contributor Author

Friendly bump!

Hey is there anything else I can do to get this merged?

@fisker fisker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thorn0

thorn0 commented May 29, 2020 •

Copy link
Copy Markdown
Member

#7592 seems to fix the same thing and cover more edge cases.

@thorn0

thorn0 commented May 29, 2020

Copy link
Copy Markdown
Member

I'm going to close this PR because #7592 is indeed a more extensive fix. I should have noticed that earlier. I'm really sorry.

@thorn0 thorn0 closed this May 29, 2020
@robert-j-webb

Copy link
Copy Markdown
Contributor Author

No problem! I'm happy to see the bug go

@robert-j-webb
robert-j-webb deleted the pull3 branch May 31, 2020 04:54
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS adds spaces/line breaks in @import url

4 participants