In an frontend application I have a string of JS code which I want to present to the user.
Currently it is formatted
<div class="foo"><div><span>Bar</span></div></div>
I am looking for an npm module which can process this string so that it looks like:
<div class="foo">
<div>
<span>
Bar
</span>
</div>
</div>
I have tested several HMTL prettifiers / beautifiers but none of them seem to do do the job of adding linebreaks where non existed before.
Does anyone have any recommendations?