I would like to write to the test.html file this html:
<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>
Which will be lokk like:
<h2>
<strong>
<a href="http://awesome.com">
AwesomeCom
</a>
</strong>
<span>
is awesome
</span>
</h2>
so it is looks beauty and so on...and i tried this code:
var html = require("html");
var beautify_html = require('js-beautify').html;
var data = '<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>';
var beautyHtml= beautify_html(data);
fs.writeFile('test.html',beautyHtml, function (err) {});
But it is stays in one line...is it wrong what i wrote? or i have to add something? Thanks for the helps
via kodaek98
No comments:
Post a Comment