diff -r 34716fd837a4 -r be944660c56a wp/wp-includes/js/dist/autop.js --- a/wp/wp-includes/js/dist/autop.js Tue Dec 15 15:52:01 2020 +0100 +++ b/wp/wp-includes/js/dist/autop.js Wed Sep 21 18:19:35 2022 +0200 @@ -82,108 +82,33 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 283); +/******/ return __webpack_require__(__webpack_require__.s = "zbAn"); /******/ }) /************************************************************************/ /******/ ({ -/***/ 14: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js -var arrayWithHoles = __webpack_require__(38); - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js -var unsupportedIterableToArray = __webpack_require__(29); - -// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js -var nonIterableRest = __webpack_require__(39); - -// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js - - - - -function _slicedToArray(arr, i) { - return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); -} - -/***/ }), - -/***/ 26: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; -} - -/***/ }), - -/***/ 283: +/***/ "zbAn": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autop", function() { return autop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removep", function() { return removep; }); -/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); - - /** * The regular expression for an HTML element. * * @type {RegExp} */ -var htmlSplitRegex = function () { +const htmlSplitRegex = (() => { /* eslint-disable no-multi-spaces */ - var comments = '!' + // Start of comment, after the <. + const comments = '!' + // Start of comment, after the <. '(?:' + // Unroll the loop: Consume everything until --> is found. '-(?!->)' + // Dash not followed by end of comment. '[^\\-]*' + // Consume non-dashes. ')*' + // Loop possessively. '(?:-->)?'; // End of comment. If not found, match all input. - var cdata = '!\\[CDATA\\[' + // Start of comment, after the <. + const cdata = '!\\[CDATA\\[' + // Start of comment, after the <. '[^\\]]*' + // Consume non-]. '(?:' + // Unroll the loop: Consume everything until ]]> is found. '](?!]>)' + // One ] not followed by end of comment. @@ -191,10 +116,10 @@ ')*?' + // Loop possessively. '(?:]]>)?'; // End of comment. If not found, match all input. - var escaped = '(?=' + // Is the element escaped? + const escaped = '(?=' + // Is the element escaped? '!--' + '|' + '!\\[CDATA\\[' + ')' + '((?=!-)' + // If yes, which type? comments + '|' + cdata + ')'; - var regex = '(' + // Capture the entire match. + const regex = '(' + // Capture the entire match. '<' + // Find start of element. '(' + // Conditional expression follows. escaped + // Find end of escaped element. @@ -203,7 +128,7 @@ ')' + ')'; return new RegExp(regex); /* eslint-enable no-multi-spaces */ -}(); +})(); /** * Separate HTML elements and comments from the text. * @@ -213,16 +138,16 @@ function htmlSplit(input) { - var parts = []; - var workingInput = input; - var match; + const parts = []; + let workingInput = input; + let match; while (match = workingInput.match(htmlSplitRegex)) { // The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`. // If the `g` flag is omitted, `index` is included. // `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number. // Assert `match.index` is a number. - var index = + const index = /** @type {number} */ match.index; parts.push(workingInput.slice(0, index)); @@ -247,14 +172,14 @@ function replaceInHtmlTags(haystack, replacePairs) { // Find all elements. - var textArr = htmlSplit(haystack); - var changed = false; // Extract all needles. + const textArr = htmlSplit(haystack); + let changed = false; // Extract all needles. - var needles = Object.keys(replacePairs); // Loop through delimiters (elements) only. + const needles = Object.keys(replacePairs); // Loop through delimiters (elements) only. - for (var i = 1; i < textArr.length; i += 2) { - for (var j = 0; j < needles.length; j++) { - var needle = needles[j]; + for (let i = 1; i < textArr.length; i += 2) { + for (let j = 0; j < needles.length; j++) { + const needle = needles[j]; if (-1 !== textArr[i].indexOf(needle)) { textArr[i] = textArr[i].replace(new RegExp(needle, 'g'), replacePairs[needle]); @@ -292,9 +217,8 @@ */ -function autop(text) { - var br = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var preTags = []; +function autop(text, br = true) { + const preTags = []; if (text.trim() === '') { return ''; @@ -308,20 +232,20 @@ */ if (text.indexOf('
'); - var lastText = textParts.pop(); + const textParts = text.split(''); + const lastText = textParts.pop(); text = ''; - for (var i = 0; i < textParts.length; i++) { - var textPart = textParts[i]; - var start = textPart.indexOf(''; + const name = ''; preTags.push([name, textPart.substr(start) + '']); text += textPart.substr(0, start) + name; } @@ -331,7 +255,7 @@ text = text.replace(/
. - texts.forEach(function (textPiece) { + texts.forEach(textPiece => { text += '
' + textPiece.replace(/^\n*|\n*$/g, '') + '
\n'; }); // Under certain strange conditions it could create a P of entirely whitespace. @@ -404,15 +328,11 @@ if (br) { // Replace newlines that shouldn't be touched with a placeholder. - text = text.replace(/<(script|style).*?<\/\\1>/g, function (match) { - return match[0].replace(/\n/g, 'tags with their original content. - preTags.forEach(function (preTag) { - var _preTag = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(preTag, 2), - name = _preTag[0], - original = _preTag[1]; - + preTags.forEach(preTag => { + const [name, original] = preTag; text = text.replace(name, original); }); // Restore newlines in all elements. @@ -455,14 +372,14 @@ */ function removep(html) { - var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure'; - var blocklist1 = blocklist + '|div|p'; - var blocklist2 = blocklist + '|pre'; + const blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure'; + const blocklist1 = blocklist + '|div|p'; + const blocklist2 = blocklist + '|pre'; /** @type {string[]} */ - var preserve = []; - var preserveLinebreaks = false; - var preserveBr = false; + const preserve = []; + let preserveLinebreaks = false; + let preserveBr = false; if (!html) { return ''; @@ -470,7 +387,7 @@ if (html.indexOf('