HtmlCompress
HtmlCompress copied to clipboard
Feature request: extend API to allow setting options on HtmlMin + to add patterns
Introduce compressor()
method to HtmlCompressor
interface.
This will allow direct access to HtmlMin
API.
$parser = \WyriHaximus\HtmlCompress\Factory::construct();
$htmlMinInstance = $parser->compressor();
$htmlMinInstance->doRemoveHttpPrefixFromAttributes();
$htmlMinInstance->doMakeSameDomainsLinksRelative(['example.com']);
$compressedHtml = $parser->compress($sourceHtml);
Introduce patterns()
method to HtmlCompressor
interface.
Introduce add(PatternInterface $pattern)
method to Patterns
class.
This will allow usage such as this:
$parser = \WyriHaximus\HtmlCompress\Factory::construct();
$patterns = $parser->patterns();
$patterns->add(CustomPatternThatImplementsPatternInterface);
$compressedHtml = $parser->compress($sourceHtml);