xml-zero-beautify
v2.0.5
Published
Supports HTML, XML, and JSX
Downloads
173
Maintainers
Readme
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"><p></span><br/>
// <span class="b-text">shadows</span><br/>
// <span class="b-tag"></p></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