@greatenemy/html-prettifier

Wrapper around clean-html that newlines all tags and returns value directly without callback.

Usage no npm install needed!

<script type="module">
  import greatenemyHtmlPrettifier from 'https://cdn.skypack.dev/@greatenemy/html-prettifier';
</script>

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