# Pretty Diff, a language aware file comparison tool, beautifier, minifier and parser.

## Announcement —

- NPM
- GitHub
- Documentation

Function Compare Beautify Minify Parse Table

Latest Commit:14 Jan 2019 Version: 100.1.7

Accessibility note: Hold shift and press control key twice to focus on the previous element or press control twice to focus away from this textarea.

## Compare Code

Compare source file

Source code label (sourcelabel)

Compare source code

Compare new file

New code label (difflabel)

Compare new code

## Reporting data which updates with each use of the tool

###

Please feel free to submit feedback about Pretty Diff at any time by answering the following questions.

How likely are you to recommend Pretty Diff to a friend or coworker? 1 Never 2 Not Likely 3 Rarely 4 Maybe 5 Probably 6 Frequently 7 Always

What is your primary reason for the above answer?

Email address (optional)

###

###

General statistics
Total number of page loads | 0
Total usage count | 0
Start date of logging |
Average page loads per day | 0
Average uses per day | 0
Largest code source | 0
Usage statistics
Diff | 0
Beautification | 0
Minification | 0
Parse Table | 0
Analysis | 0
Language statistics
Markup | 0
JavaScript | 0
CSS | 0
CSV | 0
Plain text | 0

## Web Tool Options

- Ace Code Editor

  Enable Ace Code Editor Disable Ace Code Editor (Faster and more accessible)

- Local Storage (localStorage)

  Save nothing Save input and application state in local browser
- Pretty Diff Comment /*prettydiff.com */

## Pretty Diff Options

- Brace Lines (brace_line)

  false true

  If true an empty line will be inserted after opening curly braces and before closing curly braces.

- Brace Padding (brace_padding)

  false true

  Inserts a space after the start of a container and before the end of the container if the contents of that container are not indented; such as: conditions, function arguments, and escaped sequences of template strings.

- Brace Style (brace_style)

  Emulates JSBeautify's brace_style option using existing Pretty Diff options. none — Ignores this option

- Style of Indent (braces)

  false true

  Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line.

- Color (color)

  The color scheme of the reports. white — A white and pale grey color scheme

- Force an Empty Line Above Comments (comment_line)

  false true

  If a blank new line should be forced above comments.

- Indent Comments (comments)

  false true

  This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code.

- Generate A Complete HTML File (complete_document)

  false true

  Allows a preference for generating a complete HTML document instead of only generating content.

- Compressed CSS (compressed_css)

  false true

  If CSS should be beautified in a style where the properties and values are minifed for faster reading of selectors.

- IE Comments (HTML Only) (conditional)

  false true

  If true then conditional comments used by Internet Explorer are preserved at minification of markup.

- Ignore Content (content)

  false true

  This will normalize all string content to 'text' so as to eliminate some differences from the output.

- Fix Sloppy Code (correct)

  false true

  Automatically correct some sloppiness in code.

- Line Termination (crlf)

  false true

  If line termination should be Windows (CRLF) format. Unix (LF) format is the default.

- Insert Empty Lines (css_insert_lines)

  false true

  Inserts new line characters between every CSS code block.

- Code Comments (diff_comments)

  false true

  If true then comments will be preserved so that both code and comments are compared by the diff engine.

- Context Size (diff_context)

  This shortens the diff output by allowing a specified number of equivalent lines between each line of difference. This option is only used with diff_format:html.

- Diff Format (diff_format)

  The format of the output. The command line output format is text, similar to Unix 'diff'. text — Formatted similar to the Unix 'diff' command line utility.

- Label for Diff Sample (diff_label)

  This allows for a descriptive label for the diff file code of the diff HTML output.

- Compare Rendered HTML (diff_rendered_html)

  false true

  Compares complete HTML documents and injects custom CSS so that the differences display not in the code, but in the rendered page in a browser. This option is currently confined only to markup languages, read_method file, and mode diff. Option diff_format is ignored.

- Remove White Space (diff_space_ignore)

  false true

  If white space only differences should be ignored by the diff tool.

- Diff View Type (diff_view)

  This determines whether the diff HTML output should display as a side-by-side comparison or if the differences should display in a single table column. sidebyside — Two column comparison of changes.

- Else On New Line (else_line)

  false true

  If else_line is true then the keyword 'else' is forced onto a new line.

- End Index (end)

  The last index to process. This option is useful internally when recursively sliding between various libraries. The default value of 0 means to ignore this option.

- Trailing Comma (end_comma)

  If there should be a trailing comma in arrays and objects. Value "multiline" only applies to modes beautify and diff. never — Remove trailing commas

- Force Indentation of All Attributes (force_attribute)

  false true

  If all markup attributes should be indented each onto their own line.

- Force Indentation of All Content (force_indent)

  false true

  Will force indentation upon all content and tags without regard for the creation of new text nodes.

- Formatting Arrays (format_array)

  Determines if all array indexes should be indented, never indented, or left to the default. default — Default formatting

- Formatting Objects (format_object)

  Determines if all object keys should be indented, never indented, or left to the default. default — Default formatting

- Space After Function Name (function_name)

  false true

  If a space should follow a JavaScript function name.

- Indentation Characters (indent_char)

  The string characters to comprise a single indentation. Any string combination is accepted.

- Indentation Padding (indent_level)

  How much indentation padding should be applied to beautification? This option is internally used for code that requires switching between libraries.

- Indent Size (indent_size)

  The number of 'inchar' values to comprise a single indentation.

- JavaScript Scope Identification (jsscope)

  An educational tool to generate HTML output of JavaScript code to identify scope regions and declared references by color. This option is ignored unless the code language is JavaScript or TypeScript. none — prevents use of this option

- Language (language)

  The lowercase single word common name of the source code's programming language. The value 'auto' imposes language and lexer auto-detection, which ignores deliberately specified lexer values. The value 'text' is converted to 'auto' if options 'mode' is not 'diff'. Value 'text' allows literal comparisons.

- Language Auto-Detection Default (language_default)

  The fallback option if option 'lang' is set to 'auto' and a language cannot be detected.

- Formatted Name of the Code's Language (language_name)

  The formatted proper name of the code sample's language for use in reports read by people.

- Parsing Lexer (lexer)

  This option determines which sets of rules to use in the language parser. If option 'language' has a value of 'auto', which is the default value, this option is ignored. The value 'text' is converted to 'auto' if options 'mode' is not 'diff'. Value 'text' allows literal comparisons. auto — The value 'auto' imposes language and lexer auto-detection, which ignores deliberately specified language values.

- Method Chains (method_chain)

  When to break consecutively chained methods and properties onto separate lines. A negative value disables this option. A value of 0 ensures method chains are never broken.

- Minification Wrapping (minify_wrap)

  false true

  Whether minified script should wrap after a specified character width. This option requires a value from option 'wrap'.

- Never Flatten Destructured Lists (never_flatten)

  false true

  If destructured lists in script should never be flattend.

- New Line at End of Code (new_line)

  false true

  Insert an empty line at the end of output.

- Case Indentation (no_case_indent)

  false true

  If a case statement should receive the same indentation as the containing switch block.

- Leading 0s (no_lead_zero)

  false true

  Whether leading 0s in CSS values immediately preceeding a decimal should be removed or prevented.

- Object/Attribute Sort (object_sort)

  false true

  Sorts markup attributes and properties by key name in script and style.

- Parse Format (parse_format)

  Determines the output format for 'parse' mode. parallel — returns an object containing series of parallel arrays

- Retain White Space Tokens in Parse Output (parse_space)

  false true

  Whether whitespace tokens should be included in markup parse output.

- Preserve Consecutive New Lines (preserve)

  The maximum number of consecutive empty lines to retain.

- Eliminate Word Wrap Upon Comments (preserve_comment)

  false true

  Prevent comment reformatting due to option wrap.

- Preserve Markup Text White Space (preserve_text)

  false true

  If text in the provided markup code should be preserved exactly as provided. This option eliminates beautification and wrapping of text content.

- Normalize Quotes (quote)

  false true

  If true and mode is 'diff' then all single quote characters will be replaced by double quote characters in both the source and diff file input so as to eliminate some differences from the diff report HTML output.

- Indent Size (quote_convert)

  If the quotes of script strings or markup attributes should be converted to single quotes or double quotes. none — Ignores this option

- Indent Size (selector_list)

  false true

  If comma separated CSS selectors should present on a single line of code.

- Indent Size (semicolon)

  false true

  If true and mode is 'diff' and lang is 'javascript' all semicolon characters that immediately preceed any white space containing a new line character will be removed so as to elimate some differences from the code comparison.

- Label for Source Sample (source_label)

  This allows for a descriptive label of the source file code for the diff HTML output.

- Function Space (space)

  false true

  Inserts a space following the function keyword for anonymous functions.

- Close Markup Self-Closing Tags with a Space (space_close)

  false true

  Markup self-closing tags end will end with ' />' instead of '/>'.

- Start Index (start)

  The parse table index to start working from. This is internally used for code samples that require switching between different libraries.

- Script Styleguide (styleguide)

  Provides a collection of option presets to easily conform to popular JavaScript style guides. none — Ignores this option

- Merge Adjacent Start and End tags (tag_merge)

  false true

  Allows immediately adjacement start and end markup tags of the same name to be combined into a single self-closing tag.

- Sort Markup Child Items (tag_sort)

  false true

  Sort child items of each respective markup parent element.

- Keep Ternary Statements On One Line (ternary_line)

  false true

  If ternary operators in JavaScript ? and : should remain on the same line.

- Retain Comment At Code Start (top_comments)

  false true

  If mode is 'minify' this determines whether comments above the first line of code should be kept.

- Markup Tag Preservation (unformatted)

  false true

  If markup tags should have their insides preserved. This option is only available to markup and does not support child tokens that require a different lexer.

- Variable Declaration Lists (variable_list)

  If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated. none — Ignores this option.

- Vertical Alignment (vertical)

  false true

  If lists of assignments and properties should be vertically aligned. This option is not used with the markup lexer.

- Wrap (wrap)

  Character width limit before applying word wrap. A 0 value disables this option. A negative value concatenates script strings.