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

Default prettyhtml formatter doesn't always preserve whitespace #1018

Open
3 tasks done
chrisvfritz opened this issue Dec 7, 2018 · 1 comment
Open
3 tasks done

Comments

@chrisvfritz
Copy link

chrisvfritz commented Dec 7, 2018

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Independent
  • Vetur version: 0.14.3
  • VS Code version: 1.30.0-insiders

Problem

The default prettyhtml formatter doesn't seem to respect strict whitespace preservation in some cases.

Reproducible Case

For example:

<h1>
  404
  <template v-if="resource">
    the {{ resource }} was
  </template>
  not found
</h1>

reformats to:

<h1>
  404
  <template v-if="resource">the {{ resource }} was</template>not found
</h1>

Which may render as:

the user wasnot found

As a sidenote, I'd prefer prettyhtml not to move independent nodes onto the same line when I specifically put them on separate lines. Prettier is also fixing the same problem here.

Also tagging @StarpTech.

@chrisvfritz chrisvfritz changed the title Default prettyhtml formatter breaks Default prettyhtml formatter doesn't always preserve whitespace Dec 7, 2018
@octref
Copy link
Member

octref commented Dec 12, 2018

Upstream issue: Prettyhtml/prettyhtml#90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants