Compare Code
Function
Latest Commit:18 Aug 2019 Version: 101.2.5 Sparser: 1.4.11
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.
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? Never Not Likely Rarely Maybe Probably Frequently Always
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 |
Ace Code Editor
Local Storage (localStorage)
Sort Attributes (attribute_sort)
Alphanumerically sort markup attributes. Attribute sorting is ignored on tags that contain attributes template attributes.
A comma separated list of attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires 'attribute_sort' have a value of true.
Brace Lines (brace_line)
If true an empty line will be inserted after opening curly braces and before closing curly braces.
Brace Padding (brace_padding)
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.
Emulates JSBeautify's brace_style option using existing Pretty Diff options. none — Ignores this option
Style of Indent (braces)
Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation).
Space Following Case (case_space)
If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code.
The color scheme of the reports. white — A white and pale grey color scheme
Force an Empty Line Above Comments (comment_line)
If a blank new line should be forced above comments.
Indent Comments (comments)
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)
Allows a preference for generating a complete HTML document instead of only generating content.
Compressed CSS (compressed_css)
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)
If true then conditional comments used by Internet Explorer are preserved at minification of markup.
Ignore Content (content)
This will normalize all string content to 'text' so as to eliminate some differences from the output.
Fix Sloppy Code (correct)
Automatically correct some sloppiness in code.
Line Termination (crlf)
If line termination should be Windows (CRLF) format. Unix (LF) format is the default.
Insert Empty Lines (css_insert_lines)
Inserts new line characters between every CSS code block.
Code Comments (diff_comments)
If true then comments will be preserved so that both code and comments are compared by the diff engine.
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.
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.
This allows for a descriptive label for the diff file code of the diff HTML output.
Compare Rendered HTML (diff_rendered_html)
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)
If white space only differences should be ignored by the diff tool.
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)
If else_line is true then the keyword 'else' is forced onto a new line.
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)
If all markup attributes should be indented each onto their own line.
Force Indentation of All Content (force_indent)
Will force indentation upon all content and tags without regard for the creation of new text nodes.
Determines if all array indexes should be indented, never indented, or left to the default. default — Default formatting
Determines if all object keys should be indented, never indented, or left to the default. default — Default formatting
Space After Function Name (function_name)
If a space should follow a JavaScript function name.
The string characters to comprise a single indentation. Any string combination is accepted.
How much indentation padding should be applied to beautification? This option is internally used for code that requires switching between libraries.
The number of 'indent_char' values to comprise a single indentation.
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
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.
The fallback option if option 'lang' is set to 'auto' and a language cannot be detected.
The formatted proper name of the code sample's language for use in reports read by people.
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.
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.
Keep Comments (minify_keep_comments)
Prevents minification from stripping out comments.
Minification Wrapping (minify_wrap)
Whether minified script should wrap after a specified character width. This option requires a value from option 'wrap'.
Never Flatten Destructured Lists (never_flatten)
If destructured lists in script should never be flattend.
New Line at End of Code (new_line)
Insert an empty line at the end of output.
Case Indentation (no_case_indent)
If a case statement should receive the same indentation as the containing switch block.
Leading 0s (no_lead_zero)
Whether leading 0s in CSS values immediately preceding a decimal should be removed or prevented.
No Semicolons (no_semicolon)
Removes semicolons that would be inserted by ASI. This option is in conflict with option 'correct' and takes precedence over conflicting features. Use of this option is a possible security/stability risk.
Object/Attribute Sort (object_sort)
Sorts markup attributes and properties by key name in script and style.
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)
Whether whitespace tokens should be included in markup parse output.
The maximum number of consecutive empty lines to retain.
Eliminate Word Wrap Upon Comments (preserve_comment)
Prevent comment reformatting due to option wrap.
Preserve Markup Text White Space (preserve_text)
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)
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.
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)
If comma separated CSS selectors should present on a single line of code.
Indent Size (semicolon)
If true and mode is 'diff' and lang is 'javascript' all semicolon characters that immediately precede any white space containing a new line character will be removed so as to eliminate some differences from the code comparison.
This allows for a descriptive label of the source file code for the diff HTML output.
Function Space (space)
Inserts a space following the function keyword for anonymous functions.
Close Markup Self-Closing Tags with a Space (space_close)
Markup self-closing tags end will end with ' />' instead of '/>'.
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)
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)
Sort child items of each respective markup parent element.
Keep Ternary Statements On One Line (ternary_line)
If ternary operators in JavaScript ? and : should remain on the same line.
Retain Comment At Code Start (top_comments)
If mode is 'minify' this determines whether comments above the first line of code should be kept.
Markup Tag Preservation (unformatted)
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.
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)
If lists of assignments and properties should be vertically aligned. This option is not used with the markup lexer.
Character width limit before applying word wrap. A 0 value disables this option. A negative value concatenates script strings.