PHPackages                             mamykola/html-pretty-min - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mamykola/html-pretty-min

Abandoned → [herdwatch/html-pretty-min](/?search=herdwatch%2Fhtml-pretty-min)Library[Utility &amp; Helpers](/categories/utility)

mamykola/html-pretty-min
========================

HTML minifier and indenter that works on the DOM tree

v0.2.1(5y ago)14.7kMITPHPPHP &gt;=5.4

Since Nov 5Pushed 5y agoCompare

[ Source](https://github.com/maMykola/html-pretty-min)[ Packagist](https://packagist.org/packages/mamykola/html-pretty-min)[ RSS](/packages/mamykola-html-pretty-min/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (8)Used By (0)

HTML Pretty-Min
===============

[](#html-pretty-min)

[![Build Status](https://camo.githubusercontent.com/09124ebd278961b2724397f894b5057e7eb6d87db1bb56ec906a04a30872e737/68747470733a2f2f7472617669732d63692e6f72672f776173696e6765722f68746d6c2d7072657474792d6d696e2e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/wasinger/html-pretty-min)[![Latest Version](https://camo.githubusercontent.com/379ed396fbbd8a9c7c2c794395481a13dae684bc45ba9a3970ecb942fa025b2b/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776137322f68746d6c2d7072657474792d6d696e2e737667)](https://packagist.org/packages/wa72/html-pretty-min)

HTML Pretty-Min is a PHP library for minifying and prettyprinting (indenting) HTML documents that works directly on the DOM tree of an HTML document.

Currently it has the following features:

- **Prettyprint**:

    - Indent Block-level elements, do not indent inline elements
- **Minify**:

    - Remove whitespace and newlines
    - Compress embedded Javascript using [mrclay/jsmin-php](https://packagist.org/packages/mrclay/jsmin-php)
    - Compress embedded CSS using [tubalmartin/cssmin](https://packagist.org/packages/tubalmartin/cssmin)
    - Remove some attributes when their value is empty (by default "style" and "class" attributes)
    - Remove comments, except those matching some given regular expressions (by default, IE conditional comments are kept)

Installation
------------

[](#installation)

HTML Pretty-Min is listed on [Packagist](https://packagist.org/packages/wa72/html-pretty-min).

`composer require wa72/html-pretty-min`

Usage
-----

[](#usage)

```
