Package Exports
- @starptech/prettyhtml
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@starptech/prettyhtml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Opinionated Web Component HTML formatter
- Remove superfluous white-space but still line-wrap as expected.
- Reorder attributes based on how often they occur.
- Special indentation for
custom elements
. - No content manipulation in attributes or tags.
Install
$ npm install @starptech/prettyhtml --global
Command Line
$ prettyhtml example.md ./**/*.html
Help
$ prettyhtml --help
API
const prettyhtml = require('@starptech/prettyhtml')
const result = prettyhtml(`<element></element>`)
Why
Prettier has no support for HTML.
Acknowledgement
Big thanks to the creators of the excellent rehype and unified ecosystem.