Skip to content

Commit a976440

Browse files
committed
List options in README
1 parent 5b14617 commit a976440

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2018 Christoph Singer, Web-Agentur 72
1+
Copyright (c) 2015-2025 Christoph Singer
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ $output = $pm
4545

4646
For prettyprinting, call the `indent()` method instead of `minify()`.
4747

48+
49+
The `PrettyMin()` constructor can be given an associative options array. Here are the possible option keys and their default values:
50+
```
51+
'minify_js' => true,
52+
'minify_css' => true,
53+
'remove_comments' => true,
54+
'remove_comments_exeptions' => ['/^\[if /'],
55+
'keep_whitespace_around' => [
56+
// keep whitespace around all inline elements
57+
'b', 'big', 'i', 'small', 'tt',
58+
'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var',
59+
'a', 'bdo', 'br', 'img', 'map', 'object', 'q', 'span', 'sub', 'sup',
60+
'button', 'input', 'label', 'select', 'textarea'
61+
],
62+
'keep_whitespace_in' => ['script', 'style', 'pre'],
63+
'remove_empty_attributes' => ['style', 'class'],
64+
'indent_characters' => "\t"
65+
```
66+
67+
4868
**Attention**: Because the formatting is done directly on the DOM tree, a DOMDocument object given to the `load()` method
4969
will be modified:
5070

0 commit comments

Comments
 (0)