-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Conversation
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.
src/compiler/parser/index.js
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
What is the expected version number of this pr, And when will the patch version be released? |
Ask again~ , Can someone answer my question |
As planned earlier, we'll come back for Vue 2.x after Vue 3 is officially released. |
hey @Justineo just want to check in. Any updates planned for this one? |
@posva We're not really getting much of a response regarding a timeline for this one. Any idea when this can ship? |
I also have the problem. is there any advancement on this subject ? |
The regex for whitespace was too strict and was causing $nbps; chars to
disappear from templates when
whitespace: 'condense'
is set. Changing the ruleto 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)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)