jonschlinkert / pretty

Sensible presets and some tweaks for beautifying HTML with js-beautify according to my preferences.
MIT License
137 stars 17 forks source link

Fails on mixtures of tabs and spaces #6

Closed aicioara closed 5 years ago

aicioara commented 5 years ago

If input has tabs and spaces, I would have expected the tabs to be converted to spaces (or viceversa), but instead it gets confused.

aicioara commented 5 years ago

It actually has to do with the <span>

Here is a test case

<!DOCTYPE html>
<html lang="en">
<body>
<div class="logo">
<span class="wsite-logo">
<a href="/"></a>
</span>
</div>
</body>
</html>

Expected nice indentation

Actual

<!DOCTYPE html>
<html lang="en">

  <body>
    <div class="logo">
      <span class="wsite-logo">
<a href="/"></a>
</span>
    </div>
  </body>

</html>
aicioara commented 5 years ago

Closing this, as I am using js-beautify directly.

aicioara commented 5 years ago

Actually, it is a duplicate of https://github.com/jonschlinkert/pretty/issues/7