Skip to content

Whitespace preserve does not work #7789

@AndreKR

Description

@AndreKR

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't workingscope: compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions