MDL-71719 lib: Upgrade jsbeautify to 1.14.0

This commit is contained in:
Sara Arjona
2021-12-30 12:33:10 +01:00
parent 541d999d27
commit eebf70d1e8
6 changed files with 686 additions and 1106 deletions
@@ -106,98 +106,13 @@ Y.namespace('M.atto_html').beautify = exports;
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_js =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_js;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -244,9 +159,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -795,7 +709,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
}
}
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
this._output.space_before_token = true;
}
} else {
@@ -803,7 +717,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
if (this._flags.last_token.text === 'for') {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.ForInitializer;
} else if (in_array(this._flags.last_token.text, ['if', 'while'])) {
} else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.Conditional;
} else if (in_array(this._flags.last_word, ['await', 'async'])) {
@@ -1306,7 +1220,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) {
};
Beautifier.prototype.handle_string = function(current_token) {
if (this.start_of_statement(current_token)) {
if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
//Conditional for detectign backtick strings
} else if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
// One difference - strings want at least a space before
this._output.space_before_token = true;
@@ -1318,6 +1234,8 @@ Beautifier.prototype.handle_string = function(current_token) {
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token);
}
} else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {
this._output.space_before_token = true;
} else {
this.print_newline();
}
@@ -1706,9 +1624,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -2132,9 +2049,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2193,9 +2109,8 @@ module.exports.Token = Token;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(__unused_webpack_module, exports) {
"use strict";
/* jshint node: true, curly: false */
// Parts of this section of code is taken from acorn.
//
@@ -2257,9 +2172,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2357,9 +2271,8 @@ module.exports.Options = Options;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2429,10 +2342,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -2557,9 +2470,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2628,7 +2540,7 @@ var TOKEN = {
var directives_core = new Directives(/\/\*/, /\*\//);
var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/;
var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
var digit = /[0-9]/;
@@ -2688,7 +2600,7 @@ var Tokenizer = function(input_string, options) {
html_comment_end: pattern_reader.matching(/-->/),
include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
template_text: templatable.until(/[`\\$]/),
@@ -3130,9 +3042,8 @@ module.exports.line_starters = line_starters.slice();
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3329,9 +3240,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3476,9 +3386,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3561,9 +3470,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3673,9 +3581,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3774,9 +3681,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3843,9 +3749,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3883,7 +3788,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -3904,12 +3810,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -3983,9 +3892,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -4031,6 +3945,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -4040,7 +3965,42 @@ module.exports.TemplatablePattern = TemplatablePattern;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ legacy_beautify_js = __webpack_exports__;
/******/
/******/ })()
;
var js_beautify = legacy_beautify_js;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -4129,100 +4089,15 @@ if (typeof define === "function" && define.amd) {
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_css =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_css;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -4649,9 +4524,8 @@ module.exports.Output = Output;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -4721,10 +4595,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -4850,9 +4724,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -5053,9 +4926,8 @@ module.exports.InputScanner = InputScanner;
/* 11 */,
/* 12 */,
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -5123,9 +4995,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */,
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5172,9 +5043,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5268,13 +5138,12 @@ Beautifier.prototype.eatString = function(endChars) {
// the first newline will be output
Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
var result = whitespaceChar.test(this._input.peek());
var isFirstNewLine = true;
var newline_count = 0;
while (whitespaceChar.test(this._input.peek())) {
this._ch = this._input.next();
if (allowAtLeastOneNewLine && this._ch === '\n') {
if (this._options.preserve_newlines || isFirstNewLine) {
isFirstNewLine = false;
if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
newline_count++;
this._output.add_new_line(true);
}
}
@@ -5611,7 +5480,7 @@ Beautifier.prototype.beautify = function() {
} else if (this._ch === ',') {
this.print_string(this._ch);
this.eatWhitespace(true);
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) {
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) {
this._output.add_new_line();
} else {
this._output.space_before_token = true;
@@ -5660,9 +5529,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5722,7 +5590,42 @@ module.exports.Options = Options;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(15);
/******/ legacy_beautify_css = __webpack_exports__;
/******/
/******/ })()
;
var css_beautify = legacy_beautify_css;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -5822,100 +5725,15 @@ if (typeof define === "function" && define.amd) {
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_html =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 18);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_html;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -6339,9 +6157,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6402,9 +6219,8 @@ module.exports.Token = Token;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6474,10 +6290,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -6603,9 +6419,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6802,9 +6617,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -6949,9 +6763,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7034,9 +6847,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7146,9 +6958,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7247,9 +7058,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7316,9 +7126,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7356,7 +7165,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -7377,12 +7187,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -7456,9 +7269,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -7504,6 +7322,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -7517,9 +7346,8 @@ module.exports.TemplatablePattern = TemplatablePattern;
/* 16 */,
/* 17 */,
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7566,9 +7394,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8438,9 +8265,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8536,9 +8362,8 @@ module.exports.Options = Options;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8874,7 +8699,42 @@ module.exports.TOKEN = TOKEN;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(18);
/******/ legacy_beautify_html = __webpack_exports__;
/******/
/******/ })()
;
var style_html = legacy_beautify_html;
/* Footer */
if (typeof define === "function" && define.amd) {
File diff suppressed because one or more lines are too long
@@ -106,98 +106,13 @@ Y.namespace('M.atto_html').beautify = exports;
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_js =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_js;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -244,9 +159,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -795,7 +709,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
}
}
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
this._output.space_before_token = true;
}
} else {
@@ -803,7 +717,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
if (this._flags.last_token.text === 'for') {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.ForInitializer;
} else if (in_array(this._flags.last_token.text, ['if', 'while'])) {
} else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.Conditional;
} else if (in_array(this._flags.last_word, ['await', 'async'])) {
@@ -1306,7 +1220,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) {
};
Beautifier.prototype.handle_string = function(current_token) {
if (this.start_of_statement(current_token)) {
if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
//Conditional for detectign backtick strings
} else if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
// One difference - strings want at least a space before
this._output.space_before_token = true;
@@ -1318,6 +1234,8 @@ Beautifier.prototype.handle_string = function(current_token) {
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token);
}
} else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {
this._output.space_before_token = true;
} else {
this.print_newline();
}
@@ -1706,9 +1624,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -2132,9 +2049,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2193,9 +2109,8 @@ module.exports.Token = Token;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(__unused_webpack_module, exports) {
"use strict";
/* jshint node: true, curly: false */
// Parts of this section of code is taken from acorn.
//
@@ -2257,9 +2172,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2357,9 +2271,8 @@ module.exports.Options = Options;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2429,10 +2342,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -2557,9 +2470,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2628,7 +2540,7 @@ var TOKEN = {
var directives_core = new Directives(/\/\*/, /\*\//);
var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/;
var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
var digit = /[0-9]/;
@@ -2688,7 +2600,7 @@ var Tokenizer = function(input_string, options) {
html_comment_end: pattern_reader.matching(/-->/),
include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
template_text: templatable.until(/[`\\$]/),
@@ -3130,9 +3042,8 @@ module.exports.line_starters = line_starters.slice();
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3329,9 +3240,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3476,9 +3386,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3561,9 +3470,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3673,9 +3581,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3774,9 +3681,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3843,9 +3749,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3883,7 +3788,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -3904,12 +3810,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -3983,9 +3892,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -4031,6 +3945,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -4040,7 +3965,42 @@ module.exports.TemplatablePattern = TemplatablePattern;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ legacy_beautify_js = __webpack_exports__;
/******/
/******/ })()
;
var js_beautify = legacy_beautify_js;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -4129,100 +4089,15 @@ if (typeof define === "function" && define.amd) {
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_css =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_css;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -4649,9 +4524,8 @@ module.exports.Output = Output;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -4721,10 +4595,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -4850,9 +4724,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -5053,9 +4926,8 @@ module.exports.InputScanner = InputScanner;
/* 11 */,
/* 12 */,
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -5123,9 +4995,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */,
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5172,9 +5043,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5268,13 +5138,12 @@ Beautifier.prototype.eatString = function(endChars) {
// the first newline will be output
Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
var result = whitespaceChar.test(this._input.peek());
var isFirstNewLine = true;
var newline_count = 0;
while (whitespaceChar.test(this._input.peek())) {
this._ch = this._input.next();
if (allowAtLeastOneNewLine && this._ch === '\n') {
if (this._options.preserve_newlines || isFirstNewLine) {
isFirstNewLine = false;
if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
newline_count++;
this._output.add_new_line(true);
}
}
@@ -5611,7 +5480,7 @@ Beautifier.prototype.beautify = function() {
} else if (this._ch === ',') {
this.print_string(this._ch);
this.eatWhitespace(true);
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) {
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) {
this._output.add_new_line();
} else {
this._output.space_before_token = true;
@@ -5660,9 +5529,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -5722,7 +5590,42 @@ module.exports.Options = Options;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(15);
/******/ legacy_beautify_css = __webpack_exports__;
/******/
/******/ })()
;
var css_beautify = legacy_beautify_css;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -5822,100 +5725,15 @@ if (typeof define === "function" && define.amd) {
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_html =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 18);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_html;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -6339,9 +6157,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6402,9 +6219,8 @@ module.exports.Token = Token;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6474,10 +6290,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -6603,9 +6419,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -6802,9 +6617,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -6949,9 +6763,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7034,9 +6847,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7146,9 +6958,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7247,9 +7058,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -7316,9 +7126,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7356,7 +7165,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -7377,12 +7187,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -7456,9 +7269,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -7504,6 +7322,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -7517,9 +7346,8 @@ module.exports.TemplatablePattern = TemplatablePattern;
/* 16 */,
/* 17 */,
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -7566,9 +7394,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8438,9 +8265,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8536,9 +8362,8 @@ module.exports.Options = Options;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -8874,7 +8699,42 @@ module.exports.TOKEN = TOKEN;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(18);
/******/ legacy_beautify_html = __webpack_exports__;
/******/
/******/ })()
;
var style_html = legacy_beautify_html;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -65,100 +65,15 @@
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_css =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 15);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_css;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -585,9 +500,8 @@ module.exports.Output = Output;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -657,10 +571,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -786,9 +700,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -989,9 +902,8 @@ module.exports.InputScanner = InputScanner;
/* 11 */,
/* 12 */,
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -1059,9 +971,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */,
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1108,9 +1019,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1204,13 +1114,12 @@ Beautifier.prototype.eatString = function(endChars) {
// the first newline will be output
Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
var result = whitespaceChar.test(this._input.peek());
var isFirstNewLine = true;
var newline_count = 0;
while (whitespaceChar.test(this._input.peek())) {
this._ch = this._input.next();
if (allowAtLeastOneNewLine && this._ch === '\n') {
if (this._options.preserve_newlines || isFirstNewLine) {
isFirstNewLine = false;
if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
newline_count++;
this._output.add_new_line(true);
}
}
@@ -1547,7 +1456,7 @@ Beautifier.prototype.beautify = function() {
} else if (this._ch === ',') {
this.print_string(this._ch);
this.eatWhitespace(true);
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) {
if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) {
this._output.add_new_line();
} else {
this._output.space_before_token = true;
@@ -1596,9 +1505,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1658,7 +1566,42 @@ module.exports.Options = Options;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(15);
/******/ legacy_beautify_css = __webpack_exports__;
/******/
/******/ })()
;
var css_beautify = legacy_beautify_css;
/* Footer */
if (typeof define === "function" && define.amd) {
@@ -75,100 +75,15 @@
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_html =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 18);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_html;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -592,9 +507,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -655,9 +569,8 @@ module.exports.Token = Token;
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -727,10 +640,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -856,9 +769,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -1055,9 +967,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1202,9 +1113,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -1287,9 +1197,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1399,9 +1308,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -1500,9 +1408,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -1569,9 +1476,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1609,7 +1515,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -1630,12 +1537,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -1709,9 +1619,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -1757,6 +1672,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -1770,9 +1696,8 @@ module.exports.TemplatablePattern = TemplatablePattern;
/* 16 */,
/* 17 */,
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -1819,9 +1744,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2691,9 +2615,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2789,9 +2712,8 @@ module.exports.Options = Options;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3127,7 +3049,42 @@ module.exports.TOKEN = TOKEN;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(18);
/******/ legacy_beautify_html = __webpack_exports__;
/******/
/******/ })()
;
var style_html = legacy_beautify_html;
/* Footer */
if (typeof define === "function" && define.amd) {
+89 -129
View File
@@ -88,98 +88,13 @@
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_js =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
var legacy_beautify_js;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -226,9 +141,8 @@ module.exports.defaultOptions = function() {
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -777,7 +691,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
}
}
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) {
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
this._output.space_before_token = true;
}
} else {
@@ -785,7 +699,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) {
if (this._flags.last_token.text === 'for') {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.ForInitializer;
} else if (in_array(this._flags.last_token.text, ['if', 'while'])) {
} else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.Conditional;
} else if (in_array(this._flags.last_word, ['await', 'async'])) {
@@ -1288,7 +1202,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) {
};
Beautifier.prototype.handle_string = function(current_token) {
if (this.start_of_statement(current_token)) {
if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
//Conditional for detectign backtick strings
} else if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
// One difference - strings want at least a space before
this._output.space_before_token = true;
@@ -1300,6 +1216,8 @@ Beautifier.prototype.handle_string = function(current_token) {
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token);
}
} else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {
this._output.space_before_token = true;
} else {
this.print_newline();
}
@@ -1688,9 +1606,8 @@ module.exports.Beautifier = Beautifier;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
The MIT License (MIT)
@@ -2114,9 +2031,8 @@ module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2175,9 +2091,8 @@ module.exports.Token = Token;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(__unused_webpack_module, exports) {
"use strict";
/* jshint node: true, curly: false */
// Parts of this section of code is taken from acorn.
//
@@ -2239,9 +2154,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2339,9 +2253,8 @@ module.exports.Options = Options;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -2411,10 +2324,10 @@ function Options(options, merge_child_field) {
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php']
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
// For now, 'auto' = all off for javascript, all on for html (and inline javascript).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']);
this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
@@ -2539,9 +2452,8 @@ module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -2610,7 +2522,7 @@ var TOKEN = {
var directives_core = new Directives(/\/\*/, /\*\//);
var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/;
var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
var digit = /[0-9]/;
@@ -2670,7 +2582,7 @@ var Tokenizer = function(input_string, options) {
html_comment_end: pattern_reader.matching(/-->/),
include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),
single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
template_text: templatable.until(/[`\\$]/),
@@ -3112,9 +3024,8 @@ module.exports.line_starters = line_starters.slice();
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3311,9 +3222,8 @@ module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3458,9 +3368,8 @@ module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3543,9 +3452,8 @@ module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3655,9 +3563,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3756,9 +3663,8 @@ module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module) {
"use strict";
/*jshint node:true */
/*
@@ -3825,9 +3731,8 @@ module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
/*jshint node:true */
/*
@@ -3865,7 +3770,8 @@ var template_names = {
django: false,
erb: false,
handlebars: false,
php: false
php: false,
smarty: false
};
// This lets templates appear anywhere we would do a readUntil
@@ -3886,12 +3792,15 @@ function TemplatablePattern(input_scanner, parent) {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/)
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
@@ -3965,9 +3874,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() {
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
@@ -4013,6 +3927,17 @@ TemplatablePattern.prototype._read_template = function() {
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
@@ -4022,7 +3947,42 @@ module.exports.TemplatablePattern = TemplatablePattern;
/***/ })
/******/ ]);
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ legacy_beautify_js = __webpack_exports__;
/******/
/******/ })()
;
var js_beautify = legacy_beautify_js;
/* Footer */
if (typeof define === "function" && define.amd) {