This commit is contained in:
Ahmed (OneOfOne) W 2015-02-06 06:10:35 +02:00
parent ed10ea92c4
commit 8f158ecf2a
3 changed files with 6 additions and 4 deletions

View File

@ -169,7 +169,7 @@ HTML Beautifier Options:
-m, --max-preserve-newlines Maximum number of line-breaks to be preserved in one chunk [10]
-U, --unformatted List of tags (defaults to inline) that should not be reformatted
-n, --end_with_newline End output with newline
-E, --extra_liners List of tags (defaults to inline) that should be followed by an extra newline
-E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline before them.
```
# License

View File

@ -53,7 +53,7 @@
max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk
indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}}
end_with_newline (false) - end with a newline
extra_liners (default ['html', 'head', '/html']) - add an extra newline after these tags
extra_liners (default [head,body,/html]) -List of tags that should have an extra newline before them.
e.g.
@ -121,7 +121,9 @@
: 0;
indent_handlebars = (options.indent_handlebars === undefined) ? false : options.indent_handlebars;
end_with_newline = (options.end_with_newline === undefined) ? false : options.end_with_newline;
extra_liners = Array.isArray(options.extra_liners) ? options.extra_liners : 'head,body,/html'.split(',');
extra_liners = Array.isArray(options.extra_liners) ?
options.extra_liners : (typeof options.extra_liners === 'string') ?
options.extra_liners.split(',') : 'head,body,/html'.split(',');
function Parser() {
this.pos = 0; //Parser position

View File

@ -242,7 +242,7 @@ function usage(err) {
msg.push(' -p, --preserve-newlines Preserve line-breaks (--no-preserve-newlines disables)');
msg.push(' -m, --max-preserve-newlines Number of line-breaks to be preserved in one chunk [10]');
msg.push(' -U, --unformatted List of tags (defaults to inline) that should not be reformatted');
msg.push(' -E, --extra_liners List of tags (defaults to inline) that should be followed by an extra newline');
msg.push(' -E, --extra_liners List of tags (defaults to [head,body,/html] that should have an extra newline');
break;
case "css":
msg.push(' -L, --selector-separator-newline Add a newline between multiple selectors.')