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

Whitespace preserve does not work #7789

Open
AndreKR opened this issue Feb 24, 2023 · 3 comments · May be fixed by #7829
Open

Whitespace preserve does not work #7789

AndreKR opened this issue Feb 24, 2023 · 3 comments · May be fixed by #7829
Labels
🐞 bug Something isn't working scope: compiler

Comments

@AndreKR
Copy link

AndreKR commented Feb 24, 2023

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-9bf2b5

Steps to reproduce

Check vite.config.ts, you will find that template.compilerOptions.whitespace: 'preserve' is set.

Then look at App.vue and the output.

What is expected?

I is my understanding that with whitespace: 'preserve' the output should be

image

or at least it should be easily possible to change the template so that it is.

What is actually happening?

The output is

image

and I have found no obvious way to get the desired output.

I have tried

  • adding a second <span> with a space in it
  • adding a <slot> </slot> with a space in it (found that on StackOverflow)
  • adding &#32; after the span
  • adding a space inside the <span> (which wouldn't be the desired result anyway but it doesn't change the output at all)

System Info

StackBlitz

Any additional comments?

I believe the whitespace: 'preserve' functionality was added in #1600.

@edison1105
Copy link
Member

It is inconsistent with vue2, see https://codesandbox.io/s/beautiful-tom-6zem3d?file=/src/App.vue

@edison1105 edison1105 added 🐞 bug Something isn't working scope: compiler labels Feb 26, 2023
@baiwusanyu-c
Copy link
Member

Is this the same issue? #7542
@edison1105

@edison1105
Copy link
Member

@baiwusanyu-c
No, this one is about preserving whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants