jQuery plugins commonly use $.extend({}, defaults, options) and this change
keeps that as a one-liner instead of breaking the line up (without even
indenting it).
Adds a basic test case to cover the scenario.
Under Windows, terminus.ttf doesn't include the prettiest low-res version of
Terminus (what the fuck are you doing people? It's ugly in the huge sizes! 10px
is where it's at!) so if a windows user has this font installed, it will look
ugly. So stick with the Consolas as a reasonable default instead.
browsers render the newline as a space in the link, and as a result
<a href='http://someurl.com'>Face</a> gets changed to
<a href='http://someurl.com'>
Face
</a>
For now, just don't format the <a>..</a> altogether.
Added automatic detection of escaped bookmarklets — they can be freely pasted now; also slightly cleaned and organized
the filter (Edward's packer, Javascriptobfuscator, and bookmarklet unpacking) code.
Now the following code:
var a = [
'<html>',
'<head><title>x</title></head>',
'<body>',
'<p>test</p>',
'</body>',
'</html>'];
will get neatly beautified (with keep_array_indentation) to:
var a = [
'<html>',
'<head><title>x</title></head>',
'<body>',
'<p>test</p>',
'</body>',
'</html>'];'
Also some fixes with pre-"function" blank lines have been sucked in.
This feature allows retaining the indentation in cases like this:
var markup = [
'<div>',
'<span>Hello World</span>',
some_variable,
'</div>
].join('');
when merging it together would be very undesirable.
The option is defined as "keep_array_indentation" flag in parameters for js_beautify().
Updated the vim/beautify_js script so that you can pass the command
line arguments using vim as well;
added the ability to place the extracted directory anywhere and symlink
the bin/beautify_js file to someplace like /usr/bin and still have it
work.
After installed in your .vimrc, you can do stuff like the following
:BeautifyJavascript -i 4 -n
:BeautifyJavascript -i 1 -p
Added a support for javadoc syntax, which now gets neatly indented.
Varline handling was vastly improved, like:
input:
-----
var a, b, c, d = [], e, f, g = function () {};
was:
---
var a, b, c, d = []. // <- this moment varline got flagged as unclean,
e, // so next variables get each its own line
f,
g = function () {};
now it is:
---------
var a, b, c, d = [].
e, f, g = function () {};
Some internal changes were done to preserve the flags between
block/expression mode changes.
Some projects, like bbedit script, have fallen behind the changes, and
not up to date. Moved them to "unmaintained" folder, and added a couple
of sent scripts (C#, opera) as well.