Update WordPress to 5.2
This commit is contained in:
parent
489b5a5914
commit
e00f87f2f5
599 changed files with 119573 additions and 55990 deletions
48
wp-includes/js/dist/autop.js
vendored
48
wp-includes/js/dist/autop.js
vendored
|
@ -82,19 +82,19 @@ this["wp"] = this["wp"] || {}; this["wp"]["autop"] =
|
|||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 195);
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 254);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 195:
|
||||
/***/ 254:
|
||||
/***/ (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__(25);
|
||||
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -197,11 +197,18 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|||
*
|
||||
* A group of regex replaces used to identify text formatted with newlines and
|
||||
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
||||
* breaks after conversion become <<br />> tags, unless br is set to 'false'.
|
||||
* breaks after conversion become `<br />` tags, unless br is set to 'false'.
|
||||
*
|
||||
* @param {string} text The text which has to be formatted.
|
||||
* @param {boolean} br Optional. If set, will convert all remaining line-
|
||||
* breaks after paragraphing. Default true.
|
||||
*
|
||||
* @example
|
||||
*```js
|
||||
* import { autop } from '@wordpress/autop';
|
||||
* autop( 'my text' ); // "<p>my text</p>"
|
||||
* ```
|
||||
*
|
||||
* @return {string} Text which has been converted into paragraph tags.
|
||||
*/
|
||||
|
||||
|
@ -247,7 +254,7 @@ function autop(text) {
|
|||
text = text.replace(/<br\s*\/?>\s*<br\s*\/?>/g, '\n\n');
|
||||
var allBlocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; // Add a double line break above block-level opening tags.
|
||||
|
||||
text = text.replace(new RegExp('(<' + allBlocks + '[\s\/>])', 'g'), '\n\n$1'); // Add a double line break below block-level closing tags.
|
||||
text = text.replace(new RegExp('(<' + allBlocks + '[\\s\/>])', 'g'), '\n\n$1'); // Add a double line break below block-level closing tags.
|
||||
|
||||
text = text.replace(new RegExp('(<\/' + allBlocks + '>)', 'g'), '$1\n\n'); // Standardize newline characters to "\n".
|
||||
|
||||
|
@ -305,16 +312,16 @@ function autop(text) {
|
|||
|
||||
text = text.replace(/<p>([^<]+)<\/(div|address|form)>/g, '<p>$1</p></$2>'); // If an opening or closing block element tag is wrapped in a <p>, unwrap it.
|
||||
|
||||
text = text.replace(new RegExp('<p>\s*(<\/?' + allBlocks + '[^>]*>)\s*<\/p>', 'g'), '$1'); // In some cases <li> may get wrapped in <p>, fix them.
|
||||
text = text.replace(new RegExp('<p>\\s*(<\/?' + allBlocks + '[^>]*>)\\s*<\/p>', 'g'), '$1'); // In some cases <li> may get wrapped in <p>, fix them.
|
||||
|
||||
text = text.replace(/<p>(<li.+?)<\/p>/g, '$1'); // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
|
||||
|
||||
text = text.replace(/<p><blockquote([^>]*)>/gi, '<blockquote$1><p>');
|
||||
text = text.replace(/<\/blockquote><\/p>/g, '</p></blockquote>'); // If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
|
||||
|
||||
text = text.replace(new RegExp('<p>\s*(<\/?' + allBlocks + '[^>]*>)', 'g'), '$1'); // If an opening or closing block element tag is followed by a closing <p> tag, remove it.
|
||||
text = text.replace(new RegExp('<p>\\s*(<\/?' + allBlocks + '[^>]*>)', 'g'), '$1'); // If an opening or closing block element tag is followed by a closing <p> tag, remove it.
|
||||
|
||||
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\s*<\/p>', 'g'), '$1'); // Optionally insert line breaks.
|
||||
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\\s*<\/p>', 'g'), '$1'); // Optionally insert line breaks.
|
||||
|
||||
if (br) {
|
||||
// Replace newlines that shouldn't be touched with a placeholder.
|
||||
|
@ -332,7 +339,7 @@ function autop(text) {
|
|||
} // If a <br /> tag is after an opening or closing block tag, remove it.
|
||||
|
||||
|
||||
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\s*<br \/>', 'g'), '$1'); // If a <br /> tag is before a subset of opening or closing block tags, remove it.
|
||||
text = text.replace(new RegExp('(<\/?' + allBlocks + '[^>]*>)\\s*<br \/>', 'g'), '$1'); // If a <br /> tag is before a subset of opening or closing block tags, remove it.
|
||||
|
||||
text = text.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g, '$1');
|
||||
text = text.replace(/\n<\/p>$/g, '</p>'); // Replace placeholder <pre> tags with their original content.
|
||||
|
@ -352,12 +359,19 @@ function autop(text) {
|
|||
return text;
|
||||
}
|
||||
/**
|
||||
* Replaces <p> tags with two line breaks. "Opposite" of autop().
|
||||
* Replaces `<p>` tags with two line breaks. "Opposite" of autop().
|
||||
*
|
||||
* Replaces <p> tags with two line breaks except where the <p> has attributes.
|
||||
* Unifies whitespace. Indents <li>, <dt> and <dd> for better readability.
|
||||
* Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
|
||||
* Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.
|
||||
*
|
||||
* @param {string} html The content from the editor.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { removep } from '@wordpress/autop';
|
||||
* removep( '<p>my text</p>' ); // "my text"
|
||||
* ```
|
||||
*
|
||||
* @return {string} The content with stripped paragraph tags.
|
||||
*/
|
||||
|
||||
|
@ -477,13 +491,13 @@ function removep(html) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 25:
|
||||
/***/ 28:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
||||
var arrayWithHoles = __webpack_require__(35);
|
||||
var arrayWithHoles = __webpack_require__(37);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
|
@ -512,7 +526,7 @@ function _iterableToArrayLimit(arr, i) {
|
|||
return _arr;
|
||||
}
|
||||
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
||||
var nonIterableRest = __webpack_require__(36);
|
||||
var nonIterableRest = __webpack_require__(38);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
|
||||
|
@ -525,7 +539,7 @@ function _slicedToArray(arr, i) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 35:
|
||||
/***/ 37:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -536,7 +550,7 @@ function _arrayWithHoles(arr) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 36:
|
||||
/***/ 38:
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue