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

Indentation settings of the editor are not applied when the HTML content is formatted. #2101

Closed
pankajk07 opened this issue Sep 4, 2020 · 3 comments
Assignees
Labels

Comments

@pankajk07
Copy link
Contributor

pankajk07 commented Sep 4, 2020

Steps to reproduce

  1. Go to the playground
  2. Add the code snippet provided below
  3. Right-click and select Format option from the context menu
  4. The content will be formatted with tab as the indent type.

What was expected

Since in the options insertSpaces is set to true, the content should have been formatted with indent type as spaces.

The issue seems to be in monaco-html. https://github.com/microsoft/monaco-html/blob/master/src/htmlWorker.ts#L42
Instead of taking passed in options, the global options are taken into consideration to format the content.

image

monaco-editor version: 0.20.0
Browser: Chrome
OS: macOS
Playground code that reproduces the issue:

monaco.editor.create(document.getElementById("container"), {
	value: "<html><head></head><body><div><div><div></div></div></div></body></html>",
	language: "html",
    insertSpaces: true,
    tabSize: 2,
    renderWhitespace: true,
});
@pankajk07
Copy link
Contributor Author

@alexdima Let me know if you guys are willing to accept a PR for this.

@aeschli
Copy link
Contributor

aeschli commented Sep 14, 2020

@pankajk07 Thanks for looking into this, PR is welcome!

@pankajk07
Copy link
Contributor Author

aeschli added a commit to microsoft/monaco-html that referenced this issue Sep 21, 2020
@alexdima alexdima added this to the vNext milestone Sep 21, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants