fatal('Could not parse JSON value \''+value+'\'');
}
returnvalue;
}
}
}
functionparseJSONArray(value){
if(value){
value=parseJSON(value);
returnArray.isArray(value)?value:[value];
}
}
functionparseJSONRegExpArray(value){
value=parseJSONArray(value);
returnvalue&&value.map(parseRegExp);
}
functionparseString(value){
returnvalue;
}
varmainOptions={
caseSensitive:'Treat attributes in case sensitive manner (useful for SVG; e.g. viewBox)',
collapseBooleanAttributes:'Omit attribute values from boolean attributes',
collapseInlineTagWhitespace:'Collapse white space around inline tag',
collapseWhitespace:'Collapse white space that contributes to text nodes in a document tree.',
conservativeCollapse:'Always collapse to 1 space (never remove it entirely)',
customAttrAssign:['Arrays of regex\'es that allow to support custom attribute assign expressions (e.g. \'<div flex?="{{mode != cover}}"></div>\')',parseJSONRegExpArray],
customAttrCollapse:['Regex that specifies custom attribute to strip newlines from (e.g. /ng-class/)',parseRegExp],
customAttrSurround:['Arrays of regex\'es that allow to support custom attribute surround expressions (e.g. <input {{#if value}}checked="checked"{{/if}}>)',parseJSONRegExpArray],
customEventAttributes:['Arrays of regex\'es that allow to support custom event attributes for minifyJS (e.g. ng-click)',parseJSONRegExpArray],
decodeEntities:'Use direct Unicode characters whenever possible',
html5:'Parse input according to HTML5 specifications',
ignoreCustomComments:['Array of regex\'es that allow to ignore certain comments, when matched',parseJSONRegExpArray],
ignoreCustomFragments:['Array of regex\'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>, {{ ... }})',parseJSONRegExpArray],
includeAutoGeneratedTags:'Insert tags generated by HTML parser',
keepClosingSlash:'Keep the trailing slash on singleton elements',
maxLineLength:['Max line length',parseInt],
minifyCSS:['Minify CSS in style elements and style attributes (uses clean-css)',parseJSON],
minifyJS:['Minify Javascript in script elements and on* attributes (uses uglify-js)',parseJSON],
minifyURLs:['Minify URLs in various attributes (uses relateurl)',parseJSON],
preserveLineBreaks:'Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break.',
preventAttributesEscaping:'Prevents the escaping of the values of attributes.',
processConditionalComments:'Process contents of conditional comments through minifier',
processScripts:['Array of strings corresponding to types of script elements to process through minifier (e.g. "text/ng-template", "text/x-handlebars-template", etc.)',parseJSONArray],
quoteCharacter:['Type of quote to use for attribute values (\' or ")',parseString],
removeAttributeQuotes:'Remove quotes around attributes when possible.',
removeComments:'Strip HTML comments',
removeEmptyAttributes:'Remove all attributes with whitespace-only values',
removeEmptyElements:'Remove all elements with empty contents',
removeOptionalTags:'Remove unrequired tags',
removeRedundantAttributes:'Remove attributes when value matches default.',
removeScriptTypeAttributes:'Remove type="text/javascript" from script tags. Other type attribute values are left intact.',
removeStyleLinkTypeAttributes:'Remove type="text/css" from style and link tags. Other type attribute values are left intact.',
removeTagWhitespace:'Remove space between attributes whenever possible',
sortAttributes:'Sort attributes by frequency',
sortClassName:'Sort style classes by frequency',
trimCustomFragments:'Trim white space around ignoreCustomFragments.',
useShortDoctype:'Replaces the doctype with the short (HTML5) doctype'