0.1.0 • Published 5 years ago

@greatenemy/html-prettifier v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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