Skip to content

Conversation

@alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented Nov 20, 2019

  • 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

fixes #7780

@alexander-akait
Copy link
Member Author

@thorn0 done 👍

@lydell
Copy link
Member

lydell commented Nov 21, 2019

@evilebottnawi The tests seem to be failing

@alexander-akait
Copy link
Member Author

@lydell nothing new in PR) keep in todo for investigation

@alexander-akait
Copy link
Member Author

@lydell @thorn0 trimEnd doesn't supported in node@4 what tips will be to insert a polyfill?

@thorn0
Copy link
Member

thorn0 commented Nov 25, 2019

If it's an urgent fix, you can simply use .replace(/\s+$/, "") instead. Otherwise, target the 2.0.

@alexander-akait
Copy link
Member Author

Let's do it for next, it is not high priority

@fisker fisker mentioned this pull request Feb 2, 2020
4 tasks
@thorn0 thorn0 changed the base branch from master to next March 17, 2020 09:45
@thorn0 thorn0 force-pushed the refactor-css-comments branch from 900f9f0 to d069fec Compare March 17, 2020 12:54
@thorn0 thorn0 added this to the 2.0 milestone Mar 17, 2020
@thorn0 thorn0 force-pushed the refactor-css-comments branch from 71940c0 to d33409f Compare March 17, 2020 17:01
@thorn0
Copy link
Member

thorn0 commented Mar 17, 2020

Ready for review.

(update - this is SOLVED) Known issue: quotes are stripped from inline comments in values. Difficult to fix because value-* nodes don't have correct location data, only relative to the beginning of the value. I wish postcss-values-parser had an option to pass the initial line and column.,,

Prettier pr-7021
Playground link

--parser less

Input:

a {
    opacity: // "!"
      1;
}

Output:

a {
  opacity: //  !
    1;
}

@alexander-akait
Copy link
Member Author

@thorn0 sounds good, let's open a issue after merge

@lydell
Copy link
Member

lydell commented Mar 17, 2020

Would it be possible to replace quotes in comments with some placeholder and then replace back to quotes at the end?

@thorn0
Copy link
Member

thorn0 commented Mar 17, 2020

This placeholder has to be one character long. E.g. we could use \0 for single quotes. But what about double quotes? \uffff?

@lydell
Copy link
Member

lydell commented Mar 17, 2020

Yeah, why not. I think it’s more likely that people put quotes in their comments than \0 or \uffff in their CSS.

@thorn0 thorn0 force-pushed the refactor-css-comments branch from 32ddbc3 to d97b342 Compare March 17, 2020 20:46
@thorn0 thorn0 requested review from lipis and sosukesuzuki March 17, 2020 22:04
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.

I'm not familiar with CSS and LESS, but looks very good to me.

@thorn0 thorn0 linked an issue Mar 19, 2020 that may be closed by this pull request
@thorn0 thorn0 merged commit 4602bb6 into next Mar 20, 2020
@lydell lydell deleted the refactor-css-comments branch March 20, 2020 16:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 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.

Less: single quotes in comments lead to broken output

5 participants