HTML markup formatter
npm install html-prettifySimple lightweight HTML prettifier
``js
const prettify = require('html-prettify');
const html =
v-for="(item, i) in list"
:key="i"
>
v-html="getIcon('tickIcon').html"
/>
{{ item }}
class="some-link"
href="#"
>Link
;
console.log(prettify(html));
/*
OUTPUT
'
{{ item }}
Link
*/
`
| Param | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| markup | string | yes | HTML markup to prettify |Options
| options | | no | Prettify options
| Property | Type | Required | Default | Description |
| ----- | ---- | -------- | ------ | ----------- |
| char | string | no | space | Indentation character |number` | no | 2 | Count of character per indentation level |
| count |