Unibeautify / unibeautify

One Beautifier to rule them all, One Beautifier to clean them, One Beautifier to bring them all and in the darkness sheen them
https://unibeautify.com/
MIT License
544 stars 41 forks source link

HTML properties incorrectly have there capitalization changed #235

Open DanJBower opened 5 years ago

DanJBower commented 5 years ago

Describe the bug Automatically changes the capitalization of properties in HTML. For example, *ngIf becomes *ngif. Notice the I vs the i.

To Reproduce Steps to reproduce the behavior:

1) Create a new folder and open in VSCode. I called mine "UnibeautifyTest". 2) Create a HTML file. I called mine index.html and it looks like the following.

:

<p>First name: {{ user.firstName }}</p>
<p>Surname: {{ user.surname }}</p>
<div *ngIf="user">
    <label>Enter First Name:</label>
    <input type="text"
        [(ngModel)]="user.firstName">
    <br>
    <label>Enter Surname:</label>
    <input type="text" [(ngModel)]="user.surname">
</div>

<h1>Hello, {{ user.firstName }} {{ user.surname }}</h1>`

3) Hit f1, then type "Format Document With". Hit Enter 4) Select UniBeautifier. 5) The formatted file looks like

:

<p>First name:
  {{ user.firstName }}</p>
<p>Surname:
  {{ user.surname }}</p>
<div *ngif="user">
  <label>Enter First Name:</label>
  <input type="text" [(ngmodel)]="user.firstName">
  <br>
  <label>Enter Surname:</label>
  <input type="text" [(ngmodel)]="user.surname">
</div>

<h1>Hello,
  {{ user.firstName }}
  {{ user.surname }}</h1>

Notice the *ngIf has become *ngif and ngModel has become ngmodel.

Expected behavior That this doesn't happen

Error/Stack Traces N/A

System (please complete the following information):

Additional context I am using Angular. If the properties are renamed, it breaks things. I love this extension but I require it not to change the property names.

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.96. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

stevenzeck commented 5 years ago

Waiting on https://github.com/Unibeautify/beautifier-prettydiff/pull/119

DanJBower commented 5 years ago

Hi @stevenzeck, now the PR has been merged, is there an ETA on when it will be included with the VS Code extension?

stevenzeck commented 5 years ago

@Glavin001 any objection to 1. Releasing 0.9.0 of https://github.com/Unibeautify/beautifier-prettydiff and 2. Updating prettydiff in https://github.com/Unibeautify/vscode?

DanJBower commented 4 years ago

@stevenzeck @Glavin001 Just to follow up, was this implemented?