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

Support HTML #133

Open
muuvmuuv opened this issue Nov 11, 2018 · 5 comments
Open

Support HTML #133

muuvmuuv opened this issue Nov 11, 2018 · 5 comments
Labels
add language good first issue Good for newcomers help wanted Extra attention is needed

Comments

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Nov 11, 2018

from their homepage (https://prettier.io/):

bildschirmfoto 2018-11-11 um 20 23 55

@stevenzeck
Copy link
Contributor

The only option for HTML5 is HTML Whitespace Sensitivity.

@chipco
Copy link

chipco commented Mar 31, 2019

I would also like to see an update for Prettier. It supports Angular template files, while Pretty Diff messes up these files by converting all attributes in html files to lowercase (*ngFor becomes ngfor).

Also prettier supports YAML language, which is currently not available in unibeautify.

@Glavin001 Glavin001 added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 31, 2019
@prettydiff
Copy link
Collaborator

@chipco Would you mind providing a minor code sample. In the latest major version that problem is solved by adding an additional rule to this line of code: https://github.com/Unibeautify/sparser/blob/master/lexers/markup.ts#L495

@chipco
Copy link

chipco commented Apr 1, 2019

Using unibeautify vscode extension v0.7.0

<h2>My Heroes</h2>

<div>
  <label>Hero name:
    <input #heroName />
  </label>
  <!-- (click) passes input value to add() and then clears the input -->
  <button (click)="add(heroName.value); heroName.value=''">
    add
  </button>
</div>

<ul class="heroes">
  <li *ngFor="let hero of heroes">
    <a routerLink="/detail/{{hero.id}}">
      <span class="badge">{{hero.id}}</span> {{hero.name}}
    </a>
    <button class="delete" title="delete hero"
      (click)="delete(hero)">x</button>
  </li>
</ul>

<input #heroName /> and <li *ngFor= are changed when using the settings:

"HTML": {
    "beautifiers": [
      "Pretty Diff"
    ],
    "indent_style": "space",
    "indent_size": 2,
    "end_with_newline": true,
    "max_preserve_newlines": 1,
    "preserve_newlines": true
}

@prettydiff
Copy link
Collaborator

The 2 mentioned HTML attribute problems are now solved in Pretty Diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add language good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants