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

fix(compiler): avoid converting &nbps; to spaces #11065

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

despreston
Copy link
Contributor

@despreston despreston commented Feb 2, 2020

The regex for whitespace was too strict and was causing $nbps; chars to
disappear from templates when whitespace: 'condense' is set. Changing the rule
to avoid converting non-breaking white space chars into regular spaces.

Fixes #10485
Fixes #11059

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

The regex for whitespace was too strict and was causing $nbps; chars to
disappear from templates when `whitespace: 'condense'` is set. Changing the rule
to avoid converting non-breaking white space chars into regular spaces.
@@ -38,7 +38,7 @@ const modifierRE = /\.[^.\]]+(?=[^\]]*$)/g
const slotRE = /^v-slot(:|$)|^#/

const lineBreakRE = /[\r\n]/
const whitespaceRE = /\s+/g
const whitespaceRE = /[ \t\r\n]+/g
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should use space characters defined in HTML spec here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, thats a good idea. The only possible char missing from the regex at this point would be U+000C FORM FEED (FF)

@screetBloom
Copy link

screetBloom commented Jul 23, 2020

What is the expected version number of this pr, And when will the patch version be released?

@Justineo @yyx990803

@screetBloom
Copy link

What is the expected version number of this pr, And when will the patch version be released?

Ask again~ , Can someone answer my question
@posva @yyx990803 @Justineo

@Justineo
Copy link
Member

As planned earlier, we'll come back for Vue 2.x after Vue 3 is officially released.

@despreston
Copy link
Contributor Author

hey @Justineo just want to check in. Any updates planned for this one?

@despreston
Copy link
Contributor Author

@posva We're not really getting much of a response regarding a timeline for this one. Any idea when this can ship?

@Matt-Mass
Copy link

I also have the problem. is there any advancement on this subject ?

@posva posva changed the title fix(compiler): avoid converting &nbps; to spaces (fix #11059) fix(compiler): avoid converting &nbps; to spaces Mar 9, 2021
@posva posva merged commit 55a30cf into vuejs:dev Mar 30, 2021
@despreston despreston deleted the des/whitespace-nbsp branch April 13, 2021 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants