@greatenemy/html-prettifier
v0.1.0
Published
Wrapper around clean-html that newlines all tags and returns value directly without callback.
Downloads
3
Readme
html-cleaner
A small utility library providing utility methods to 'escape' and 'unescape' HTML entities
Installation
npm install @greatenemy/html-prettifier --save
yarn add @greatenemy/html-prettifier
Usage
const htmlPrettify = require('@greatenemy/html-prettifier'),
const str_output = htmlPrettify(str_input)
Example Input:
<template lang="pug">
<p>
<div class="is-something" :bells="true">Nice
<template
v-if="ducks"><span class="text-muted">Dogs</span></template>
</div>
</p></template>
Example Output:
<template lang="pug">
<p>
<div class="is-something" :bells="true">
Nice
<template v-if="ducks">
<span class="text-muted">Dogs</span>
</template>
</div>
</p>
</template>
Tests
npm test
Release history
* 0.1.0 Initial release