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

Script comment format error #83

Closed
xiaomingplus opened this issue Dec 7, 2018 · 4 comments
Closed

Script comment format error #83

xiaomingplus opened this issue Dec 7, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@xiaomingplus
Copy link
Contributor

Before you submit an issue we recommend you drop into the Gitter community and ask any questions you have or mention any problems you've had getting started with prettyhtml.

🐛 Bug Report

Prettyhtml format comment add an intend every running format.

To Reproduce

Steps to reproduce the behavior:

Paste your markup here:

<script>
    /* test
    test */
</script>

Expected behavior

I think prettyhtml should do nothing with the comment,prettier also do nothing.

Paste the results here:

<script>
    /* test
    test */
</script>

Context

[
Vue

Your Environment

  • Prettyhtml version: 0.8.7
  • NodeJs version: 8.12
  • Environment name and version:
  • Operating System and version:
@StarpTech
Copy link
Member

Hi @xiaomingplus thank you for the bug report but this is indeed the correct behaviour. We indent the code with the base indentation. This is an opinionated approach discussed in detail here

<script>
    /* test
    test */
var a = "deded"
</script>
<script>
  /* test
      test */
  var a = "deded";
</script>

@xiaomingplus
Copy link
Contributor Author

@StarpTech oh,I may not express it clearly. I mean even you input like this:

<script>
  /* test
      test */
  var a = "deded";
</script>

it will output:

<script>
  /* test
        test */
  var a = "deded";
</script>

and format this output again ,you will get:

<script>
  /* test
          test */
  var a = "deded";
</script>

The comment intend every time when formating.

@StarpTech
Copy link
Member

@xiaomingplus thank you. I will investigate.

@StarpTech StarpTech added the bug Something isn't working label Dec 8, 2018
@StarpTech
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants