Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "prettydiff",
"version" : "2.1.17",
"version" : "2.1.18",
"description" : "Pretty Diff can minify, beautify (pretty print), or diff code to normalize white space and comments so that only code is being compared.",
"keywords" : [
"pretty diff", "minify", "beautify", "pretty print", "white space", "whitespace", "diff", "compare", "html", "javascript", "xml", "json", "css", "less", "scss", "scope", "analysis", "node", "nodejs", "wsh"
Expand Down
192 changes: 99 additions & 93 deletions api/dom.js

Large diffs are not rendered by default.

525 changes: 378 additions & 147 deletions api/node-local.js

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions barebones.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pretty Diff - The difference tool</title>
</head>
<body>
<h1>Pretty Diff, barebones example</h1>
<p><a href="documentation.xhtml">documentation</a></p>
<p>
<label for="input" style="display:block">Input</label>
<textarea id="input" style="height:200px;white-space:pre;min-width:400px">var a;function g(){return function y() {return q;};};</textarea>
</p>
<p>
<label for="object" style="display:block">Options object</label>
<textarea id="object" style="height:200px;white-space:pre;min-width:400px" data-prettydiff-ignore="true">{
"mode": "beautify",
"lang": "auto"
}</textarea>
</p>
<p>
<label for="output" style="display:block">Output</label>
<textarea id="output" style="height:200px;white-space:pre;min-width:400px"></textarea>
</p>
<p><button type="button" id="button">Beautify Code</button></p>
<script src="lib/global.js" type="application/javascript"></script>
<script src="lib/language.js" type="application/javascript"></script>
<script src="lib/options.js" type="application/javascript"></script>
<script src="lib/finalFile.js" type="application/javascript"></script>
<script src="lib/safeSort.js" type="application/javascript"></script>
<script src="lib/csspretty.js" type="application/javascript"></script>
<script src="lib/csvpretty.js" type="application/javascript"></script>
<script src="lib/diffview.js" type="application/javascript"></script>
<script src="lib/jspretty.js" type="application/javascript"></script>
<script src="lib/markuppretty.js" type="application/javascript"></script>
<script src="prettydiff.js" type="application/javascript"></script>
<script type="application/javascript">
<![CDATA[
var args = JSON.parse(document.getElementById("object").value),
button = document.getElementById("button");
button.onclick = function () {
if (typeof args.source !== "string" || args.source === "") {
args.source = document.getElementById("input").value;
}
document.getElementById("output").value = global.prettydiff.prettydiff(args);
};
]]>
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
],
"main": "./",
"name": "prettydiff",
"version": "2.1.17"
"version": "2.1.18"
}
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Pretty Diff change log

## v2.1.18

### Defects
* Fixes #420, markup attributes should not be sorted if sorting is disabled in the options
* Fixes #429, fixes regression against diffcli option

### Enhancements
* Fixes #414, better preserve whitespace adjacent to span tags in HTML
* Fixes #418, performance improvement for lib/markuppretty.js in V8 by ensuring level array contains only number types
* Fixes #422, create a new option to explicitly supply or eliminate a new line at the end of output
* Fixes #426, remove duplicate logic from lib/diffview.js
* Fixes #427, two performance improvements for new diff algorithm
* Fixes #428, performance improvement in all code for V8 by converting arithmetic assignment operators to assignments followed by separate explicit arithmetic
* Fixes #430, created a minimal barebones HTML code sample demonstrating running Pretty Diff in a generic HTML tool

## v2.1.17

### Defects
Expand Down
23 changes: 22 additions & 1 deletion documentation.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,23 @@
Function</li>
</ul>
</li>
<li id="newline">
<h4>newline</h4>
<ul>
<li>
<h5>Description</h5>
Insert an empty line at the end of output.</li>
<li>
<h5>Type</h5>
boolean</li>
<li>
<h5>Default</h5>
false</li>
<li>
<h5>As labeled in the HTML tool</h5>
Empty new line at end of output</li>
</ul>
</li>
<li id="neverflatten">
<h4>neverflatten</h4>
<ul>
Expand Down Expand Up @@ -1946,7 +1963,7 @@
<p>Pretty Diff is no longer published to NPM. For more information please see:
<a
href="https://github.com/prettydiff/prettydiff/issues/291"
style="display:block">https://github.com/prettydiff/prettydiff/issues/291</a>.</p>
style="display:block">https://github.com/prettydiff/prettydiff/issues/291</a></p>
</div>
<div class="segment" id="runcode">
<h3>Run the Code</h3>
Expand Down Expand Up @@ -2004,6 +2021,7 @@
</p>
</li>
</ul>
<p>To see an example of a bare-bones approach to running this application in custom HTML please start with <a href="barebones.xhtml">barebones.xhtml</a>, but please note this file is for demo purposes only and will not work from the prettydiff.com domain due to the site security policy. It will work on your local file system.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -2194,6 +2212,9 @@
<li>
<a href="guide/unrelated_codeisevil.xhtml">Code is Evil</a>
</li>
<li>
<a href="guide/unrelated_diff.xhtml">An explanation of the diff algorithm in Pretty Diff</a>
</li>
<li>
<a href="guide/unrelated_dom.xhtml">The DOM Explained, Quick and Simple</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion guide/closure_with_jsscope.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
4 changes: 2 additions & 2 deletions guide/codeArchitecture.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<path
d="M14871 18523 c-16 -64 -611 -2317 -946 -3588 -175 -660 -319 -1202 -320 -1204 -2 -2 -50 39 -107 91 -961 876 -2202 1358 -3498 1358 -1255 0 -2456 -451 -3409 -1279 -161 -140 -424 -408 -560 -571 -507 -607 -870 -1320 -1062 -2090 -58 -232 -386 -1479 -2309 -8759 -148 -563 -270 -1028 -270 -1033 0 -4 614 -8 1365 -8 l1364 0 10 38 c16 63 611 2316 946 3587 175 660 319 1202 320 1204 2 2 50 -39 107 -91 543 -495 1169 -862 1863 -1093 1707 -568 3581 -211 4965 946 252 210 554 524 767 796 111 143 312 445 408 613 229 406 408 854 525 1320 57 225 380 1451 2310 8759 148 563 270 1028 270 1033 0 4 -614 8 -1365 8 l-1364 0 -10 -37z m-4498 -5957 c477 -77 889 -256 1245 -542 523 -419 850 -998 954 -1689 18 -121 18 -549 0 -670 -80 -529 -279 -972 -612 -1359 -412 -480 -967 -779 -1625 -878 -121 -18 -549 -18 -670 0 -494 74 -918 255 -1283 548 -523 419 -850 998 -954 1689 -18 121 -18 549 0 670 104 691 431 1270 954 1689 365 293 828 490 1283 545 50 6 104 13 120 15 72 10 495 -3 588 -18z"/></g>
</svg>
<a href="prettydiff.com.xhtml">Pretty Diff</a>
<a href="../index.xhtml">Pretty Diff</a>
- Guide: Code Organization</h1>
<p id="dcolorScheme">
<label class="label" for="colorScheme">Color Scheme</label>
Expand All @@ -60,7 +60,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/diffcli.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/jscorrect.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/jshtml.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/nativeModules.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/prettydiffrc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/react_jsx.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/styleguide.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/tag_ignore.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/unrelated_abtest.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
2 changes: 1 addition & 1 deletion guide/unrelated_closureToAChild.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down
4 changes: 2 additions & 2 deletions guide/unrelated_codeisevil.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</select>
</p>
<p>Explore some
<a href="samples.xhtml">samples</a>
<a href="../samples.xhtml">samples</a>
or browse
<a href="https://github.com/prettydiff/prettydiff">Pretty Diff on GitHub</a>.</p>
</section>
Expand Down Expand Up @@ -504,6 +504,6 @@
</section>
</div>
<script src="../lib/global.js" type="application/javascript"></script>
<script src="api/dom.js" type="application/javascript"></script>
<script src="../api/dom.js" type="application/javascript"></script>
</body>
</html>
Loading