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

collapse consecutive whitespace characters #2258

Merged
merged 1 commit into from
Mar 18, 2019
Merged

Conversation

Rich-Harris
Copy link
Member

Sort of a last-minute thing but the prevalence of strings like "\n\n\t\t\t" in the generated code is a frequent complaint. This PR introduces a preserveWhitespace compiler option — if it's not true, and a given text node isn't inside a <pre>, those strings will be replaced with space().

There are almost certainly other things we can do to reduce the need even for these — #189 — but this seems like an obvious starting point.

@codecov-io
Copy link

codecov-io commented Mar 18, 2019

Codecov Report

Merging #2258 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2258   +/-   ##
=======================================
  Coverage   91.83%   91.83%           
=======================================
  Files           1        1           
  Lines          49       49           
=======================================
  Hits           45       45           
  Misses          4        4

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21d56c9...2b1aa77. Read the comment docs.

@Rich-Harris
Copy link
Member Author

no-one has freaked out about this so i'm going to merge it in

@Rich-Harris Rich-Harris merged commit 4348727 into master Mar 18, 2019
@Rich-Harris Rich-Harris deleted the collapse-whitespace branch March 18, 2019 20:24
@Ryuno-Ki
Copy link

I recall that there are some CSS properties controlling whitespace behaviour as well...

But I guess, people will notice and fill tickets then.

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.

3 participants