posthtml-beautify icon indicating copy to clipboard operation
posthtml-beautify copied to clipboard

[feat]: format only indent

Open Scrum opened this issue 7 years ago • 2 comments

baseb on #216 save default struct and format only indent: input.html

<html>
<div>test 1</div>

<div>test 2</div>
</html>

output.html

<html>
  <div>test 1</div>

  <div>test 2</div>
</html>

Scrum avatar Jan 24 '18 13:01 Scrum

Preserving all formatting would be brilliant. Could this feature potentially preserve formatting like this?

input.html

<div
  class="a"
  data-attr1="a"
  data-attr2="a"
  data-attr3="a"
  data-attr4="a"
>
<i class="test">test</i>
</div>

output.html

<div
  class="a"
  data-attr1="a"
  data-attr2="a"
  data-attr3="a"
  data-attr4="a"
>
  <i class="test">test</i>
</div>

Because I guess attributes wrapping can introduce some problems. This is not critical though

andreyvolokitin avatar Jan 25 '18 14:01 andreyvolokitin

Though posthtml-include and posthtml-extend already print such attributes on the same line. So this is even less relevant...

andreyvolokitin avatar Jan 25 '18 15:01 andreyvolokitin