From 0ec58cddd1af263ac3c1fbe62145e9604223836f Mon Sep 17 00:00:00 2001 From: c32hedge Date: Tue, 7 Oct 2014 11:59:25 -0400 Subject: [PATCH] Update documentation of brace style options (related to #538 and #554) --- README.md | 4 ++-- index.html | 2 ++ js/lib/beautify-html.js | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c520c1ec..750e9ab10 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Beautifier Options: -P, --space-in-paren Add padding spaces within paren, ie. f( a, b ) -j, --jslint-happy Enable jslint-stricter mode -a, --space_after_anon_function Add a space before an anonymous function's parens, ie. function () - -b, --brace-style [collapse|expand|end-expand] ["collapse"] + -b, --brace-style [collapse|expand|end-expand|none] ["collapse"] -B, --break-chained-methods Break chained method calls across subsequent lines -k, --keep-array-indentation Preserve array indentation -x, --unescape-strings Decode printable characters encoded in xNN notation @@ -158,7 +158,7 @@ HTML Beautifier Options: -I, --indent-inner-html Indent and sections. Default is false. -s, --indent-size Indentation size [4] -c, --indent-char Indentation character [" "] - -b, --brace-style [collapse|expand|end-expand] ["collapse"] + -b, --brace-style [collapse|expand|end-expand|none] ["collapse"] -S, --indent-scripts [keep|separate|normal] ["normal"] -w, --wrap-line-length Maximum characters per line (0 disables) [250] -p, --preserve-newlines Preserve existing line-breaks (--no-preserve-newlines disables) diff --git a/index.html b/index.html index 77a445d6f..fe1113bb8 100644 --- a/index.html +++ b/index.html @@ -331,6 +331,8 @@ +

HTML <style>, <script> formatting:

diff --git a/js/lib/beautify-html.js b/js/lib/beautify-html.js index 8f5904177..6e0778919 100644 --- a/js/lib/beautify-html.js +++ b/js/lib/beautify-html.js @@ -44,8 +44,8 @@ indent_size (default 4) — indentation size, indent_char (default space) — character to indent with, wrap_line_length (default 250) - maximum amount of characters per line (0 = disable) - brace_style (default "collapse") - "collapse" | "expand" | "end-expand" - put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line. + brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" + put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are. unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted indent_scripts (default normal) - "keep"|"separate"|"normal" preserve_newlines (default true) - whether existing line breaks before elements should be preserved