2.0.5 • Published 6 years ago

xml-zero-beautify v2.0.5

Weekly downloads
113
License
GPL-3.0
Repository
github
Last release
6 years ago

xml-zero-beautify

Friendly and forgiving HTML5/XML5/JSX beautifier with lots of tests. Memory-efficient and Web Worker compatible.

Features

  • Supports HTML, XML, and JSX.
  • Zero-copy

Usage

import Beautify, { OUTPUT_FORMATS } from 'xml-zero-beautifier';

const plaintext = Beautify('<p>shadows</p>');
// result is,
// <p>
//   shadows
// </p>

const html = Beautify('<p>shadows</p>', { output: OUTPUT_FORMATS.html });
// result is,
// <span class="b-tag">&lt;p&gt;</span><br/>
//  &nbsp;<span class="b-text">shadows</span><br/>
// <span class="b-tag">&lt;/p&gt;</span><br/>

So you can style those classes.

The "b-" prefix is configurable, just pass `outputHtmlClassPrefix: "conflict-free-",

8KB gzipped (that includes all deps).

Just want a lexer? Try xml-zero-lexer.


Part of XML-Zero.js

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago