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

Extra indents being added for format selection with contentUnformatted tag #29

Open
mjbvz opened this issue Jul 9, 2018 · 2 comments
Open
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@mjbvz
Copy link

mjbvz commented Jul 9, 2018

1 .Create a html document:


    <pre>
        stuff
    </pre>

  1. Select from the start of the second line to the end of the file
  2. Run format selection

Bug
Document becomes:


    <pre>
            stuff
        </pre>

If you continue running the command, more indents are added

@mjbvz mjbvz changed the title Extra indents being added for format selection with unformattedContent tag Extra indents being added for format selection with contentUnformatted tag Jul 9, 2018
bitwiseman added a commit to bitwiseman/vscode-html-languageservice that referenced this issue Aug 21, 2018
@bitwiseman
Copy link
Contributor

bitwiseman commented Aug 21, 2018

Created a test for this in https://github.com/bitwiseman/vscode-html-languageservice/tree/issue-29
The cause is that the beautifier itself doesn't have a concept of ranges, combined with the fact that the correct behavior for pre is to retain leading whitespace.

To be clear, this is a bug, but the correct behavior will require some indent parsing.

@aeschli aeschli added the bug Issue identified by VS Code Team member as probable bug label Oct 14, 2019
@aeschli aeschli added this to the Backlog milestone Oct 14, 2019
@frankli0324
Copy link

frankli0324 commented Jul 19, 2023

Sorry to disturb but I can't help to ask, will this be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants