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

Formatting is pushing code tags #2520

Closed
webdevnerdstuff opened this issue Mar 17, 2023 · 1 comment
Closed

Formatting is pushing code tags #2520

webdevnerdstuff opened this issue Mar 17, 2023 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@webdevnerdstuff
Copy link

Volar v1.2.0
Vue v3.2.47
VSCode v1.76.2

Issue
When saving and/or formatting code, it will keep pushing a <code> tag indefinitely. This can and will affect indentation within the code block.

Example Code:
This will push the entire code block.

<template>
  <div>
    <pre>
      <code>
        const foo = 'bar'
      </code>
    </pre>
  </div>
</template>

This will push the entire code block after the opening code tag.

<template>
  <div>
    <code>
      const foo = 'bar'
    </code>
  </div>
</template>

Steps to replicate:

  1. Add that code to a .vue file.
  2. Format the code.
  3. Notice the <code> tag will keep indenting each time you save/format.

Setting in VSCode:

  "[vue]": {
    "editor.defaultFormatter": "Vue.volar"
  },
@idlist
Copy link

idlist commented Mar 25, 2023

Have a similar issue with multi-line attribute value here (discussion#2512), might be the same source.

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Mar 25, 2023
johnsoncodehk added a commit that referenced this issue Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

3 participants