-
-
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
With whitespace:condense
all  s;, even meaningful, are converted to spaces
#11059
Comments
Shouldn't we not touch non-breakable spaces in general? That's what I would personally expect if I use one in my template. It would also fix the issue you mentioned |
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.
Wait, I'm confused. Is I've been struggling to figure out why none of my non-breakable spaces are working. I was going to try forcing preserve, but then saw: Evan saying default is And compiler option docs that echo that statement https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#options Now after seeing @aimozg say Are the docs/implementation wrong? Either way, why would condense eliminate nbsp? Very unexpected behavior. I agree they shouldn't be touched. |
White spaces are preserved in Vue core to ensure backward compatibility while in latest versions of Vue CLI we configure that to |
same with escaped tab Makes very hard to display the code |
Waiting for this to be merged..
instead of
|
Version
2.6.11
Reproduction link
https://gist.github.com/aimozg/c073eea5a55062e3dcd8f887a8567807
Steps to reproduce
Run example.js in Node.
Alternative steps/Detailed explanation:
whitespace: 'condense'
. (it is default for vue-cli).
entity, e.g.<p>a b</p>
What is expected?
entity rendered as non-breaking space character; example.js output should containWhat is actually happening?
entity is rendered as plain space, example.js output containsThe whitespace is stripped by this compiler code:
and
" "
s are replaced by"\xA0"
s with entity decoder earlier.Related issues is #10485
Suggestion:
Narrower whitespaceRE regexp, like
/[ \t\r\n]+/g
.The text was updated successfully, but these errors were encountered: