html-beautify

Inserts spaces and line breaks into html string.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
html-beautify
1.0.47 years ago7 years agoMinified + gzip package size for html-beautify in KB

Readme

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.