1.0.4 • Published 7 years ago

html-beautify v1.0.4

Weekly downloads
146
License
ISC
Repository
github
Last release
7 years ago

alt tag

How it work?

Inserts spaces and break lines into html string. It looks like this:

<!-- Before -->
<div><p>Hello <b>world</b>!</p><p>How are you?</p></div>

<!-- After -->
<div>
  <p>Hello <b>world</b>!</p>
  <p>How are you?</p>
</div>

How to use?

import htmlBeautify from 'html-beautify'
htmlBeautify("<div><p>Hello <b>world</b>!</p></div>")
// => "<div>\n  <p>Hello <b>world</b>!\n  </p>\n</div>"

Also you can pass string with spaces and break lines, it will be remove it and add them again.