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

feat(compiler): remove whitespace from static class attributes #4432

Merged
merged 8 commits into from
Sep 7, 2021

Conversation

royeden
Copy link
Contributor

@royeden royeden commented Aug 24, 2021

See issue #4251

Fixes compiled whitespace in static class attributes being preserved:

This repro compiles the following

<div class="
  asdf  
">Hello World!</div>

into

_createElementBlock("div", { class: "\n  asdf  \n" }, "Hello World!")

preserving whitespace after parsing.

This PR fixes that and normalizes whitespace in the DOM in case it's added via :class or :style binding.

Close #4251

packages/compiler-core/src/parse.ts Outdated Show resolved Hide resolved
@yyx990803
Copy link
Member

After taking another look, I believe the runtime changes are not necessary when the compiler already outputs condensed class names, so I refactored to remove unnecessary abstractions.

@yyx990803 yyx990803 merged commit b8653d3 into vuejs:master Sep 7, 2021
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.

Compiler: condense known attributes whitespace
2 participants