Editor: Second round of package updates ahead of RC3.
Props ellatrix, peterwilsoncc, get_dave, mcsf, talldanwp, youknowriad, desrosj. Built from https://develop.svn.wordpress.org/trunk@51426 git-svn-id: http://core.svn.wordpress.org/trunk@51037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
10f7a91fa7
commit
b8c451cdec
File diff suppressed because one or more lines are too long
|
@ -2774,6 +2774,14 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
||||||
content: attr(aria-label);
|
content: attr(aria-label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-rich-text-script] {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
[data-rich-text-script]::before {
|
||||||
|
content: "</>";
|
||||||
|
background: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
.block-editor-skip-to-selected-block {
|
.block-editor-skip-to-selected-block {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -9999em;
|
top: -9999em;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2774,6 +2774,14 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
||||||
content: attr(aria-label);
|
content: attr(aria-label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-rich-text-script] {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
[data-rich-text-script]::before {
|
||||||
|
content: "</>";
|
||||||
|
background: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
.block-editor-skip-to-selected-block {
|
.block-editor-skip-to-selected-block {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -9999em;
|
top: -9999em;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -20174,14 +20174,15 @@ var diff_character = __webpack_require__("iA5R");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const BlockView = ({
|
|
||||||
|
function BlockView({
|
||||||
title,
|
title,
|
||||||
rawContent,
|
rawContent,
|
||||||
renderedContent,
|
renderedContent,
|
||||||
action,
|
action,
|
||||||
actionText,
|
actionText,
|
||||||
className
|
className
|
||||||
}) => {
|
}) {
|
||||||
return Object(external_wp_element_["createElement"])("div", {
|
return Object(external_wp_element_["createElement"])("div", {
|
||||||
className: className
|
className: className
|
||||||
}, Object(external_wp_element_["createElement"])("div", {
|
}, Object(external_wp_element_["createElement"])("div", {
|
||||||
|
@ -20192,16 +20193,14 @@ const BlockView = ({
|
||||||
className: "block-editor-block-compare__html"
|
className: "block-editor-block-compare__html"
|
||||||
}, rawContent), Object(external_wp_element_["createElement"])("div", {
|
}, rawContent), Object(external_wp_element_["createElement"])("div", {
|
||||||
className: "block-editor-block-compare__preview edit-post-visual-editor"
|
className: "block-editor-block-compare__preview edit-post-visual-editor"
|
||||||
}, renderedContent)), Object(external_wp_element_["createElement"])("div", {
|
}, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(renderedContent)))), Object(external_wp_element_["createElement"])("div", {
|
||||||
className: "block-editor-block-compare__action"
|
className: "block-editor-block-compare__action"
|
||||||
}, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
}, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
|
||||||
isSecondary: true,
|
isSecondary: true,
|
||||||
tabIndex: "0",
|
tabIndex: "0",
|
||||||
onClick: action
|
onClick: action
|
||||||
}, actionText)));
|
}, actionText)));
|
||||||
};
|
}
|
||||||
|
|
||||||
/* harmony default export */ var block_view = (BlockView);
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js
|
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js
|
||||||
|
|
||||||
|
@ -20252,35 +20251,27 @@ function BlockCompare({
|
||||||
const newBlocks = Object(external_lodash_["castArray"])(convertedBlock); // Get converted block details
|
const newBlocks = Object(external_lodash_["castArray"])(convertedBlock); // Get converted block details
|
||||||
|
|
||||||
const newContent = newBlocks.map(item => Object(external_wp_blocks_["getSaveContent"])(item.name, item.attributes, item.innerBlocks));
|
const newContent = newBlocks.map(item => Object(external_wp_blocks_["getSaveContent"])(item.name, item.attributes, item.innerBlocks));
|
||||||
const renderedContent = newBlocks.map(item => Object(external_wp_blocks_["getSaveElement"])(item.name, item.attributes, item.innerBlocks));
|
return newContent.join('');
|
||||||
return {
|
|
||||||
rawContent: newContent.join(''),
|
|
||||||
renderedContent
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const original = {
|
|
||||||
rawContent: block.originalContent,
|
|
||||||
renderedContent: Object(external_wp_blocks_["getSaveElement"])(block.name, block.attributes)
|
|
||||||
};
|
|
||||||
const converted = getConvertedContent(convertor(block));
|
const converted = getConvertedContent(convertor(block));
|
||||||
const difference = getDifference(original.rawContent, converted.rawContent);
|
const difference = getDifference(block.originalContent, converted);
|
||||||
return Object(external_wp_element_["createElement"])("div", {
|
return Object(external_wp_element_["createElement"])("div", {
|
||||||
className: "block-editor-block-compare__wrapper"
|
className: "block-editor-block-compare__wrapper"
|
||||||
}, Object(external_wp_element_["createElement"])(block_view, {
|
}, Object(external_wp_element_["createElement"])(BlockView, {
|
||||||
title: Object(external_wp_i18n_["__"])('Current'),
|
title: Object(external_wp_i18n_["__"])('Current'),
|
||||||
className: "block-editor-block-compare__current",
|
className: "block-editor-block-compare__current",
|
||||||
action: onKeep,
|
action: onKeep,
|
||||||
actionText: Object(external_wp_i18n_["__"])('Convert to HTML'),
|
actionText: Object(external_wp_i18n_["__"])('Convert to HTML'),
|
||||||
rawContent: original.rawContent,
|
rawContent: block.originalContent,
|
||||||
renderedContent: original.renderedContent
|
renderedContent: block.originalContent
|
||||||
}), Object(external_wp_element_["createElement"])(block_view, {
|
}), Object(external_wp_element_["createElement"])(BlockView, {
|
||||||
title: Object(external_wp_i18n_["__"])('After Conversion'),
|
title: Object(external_wp_i18n_["__"])('After Conversion'),
|
||||||
className: "block-editor-block-compare__converted",
|
className: "block-editor-block-compare__converted",
|
||||||
action: onConvert,
|
action: onConvert,
|
||||||
actionText: convertButtonText,
|
actionText: convertButtonText,
|
||||||
rawContent: difference,
|
rawContent: difference,
|
||||||
renderedContent: converted.renderedContent
|
renderedContent: converted
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28568,6 +28559,7 @@ useBlockProps.save = external_wp_blocks_["__unstableGetBlockProps"];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
@ -28675,11 +28667,12 @@ function block_BlockListBlock({
|
||||||
let block;
|
let block;
|
||||||
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
|
const saveContent = Object(external_wp_blocks_["getSaveContent"])(blockType, attributes);
|
||||||
block = Object(external_wp_element_["createElement"])(Block, {
|
block = Object(external_wp_element_["createElement"])(Block, {
|
||||||
className: "has-warning"
|
className: "has-warning"
|
||||||
}, Object(external_wp_element_["createElement"])(block_invalid_warning, {
|
}, Object(external_wp_element_["createElement"])(block_invalid_warning, {
|
||||||
clientId: clientId
|
clientId: clientId
|
||||||
}), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_blocks_["getSaveElement"])(blockType, attributes)));
|
}), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(saveContent)));
|
||||||
} else if (mode === 'html') {
|
} else if (mode === 'html') {
|
||||||
// Render blockEdit so the inspector controls don't disappear.
|
// Render blockEdit so the inspector controls don't disappear.
|
||||||
// See #8969.
|
// See #8969.
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -87,6 +87,13 @@ this["wp"] = this["wp"] || {}; this["wp"]["blockLibrary"] =
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/ ({
|
/******/ ({
|
||||||
|
|
||||||
|
/***/ "1CF3":
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
(function() { module.exports = window["wp"]["dom"]; }());
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "1K8p":
|
/***/ "1K8p":
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
@ -9633,6 +9640,7 @@ const buttons_deprecated_deprecated = [{
|
||||||
* WordPress dependencies
|
* WordPress dependencies
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
@ -9679,12 +9687,11 @@ const buttons_transforms_transforms = {
|
||||||
transform: buttons => // Creates the buttons block
|
transform: buttons => // Creates the buttons block
|
||||||
Object(external_wp_blocks_["createBlock"])(buttons_transforms_name, {}, // Loop the selected buttons
|
Object(external_wp_blocks_["createBlock"])(buttons_transforms_name, {}, // Loop the selected buttons
|
||||||
buttons.map(attributes => {
|
buttons.map(attributes => {
|
||||||
// Remove any HTML tags
|
const element = Object(external_wp_richText_["__unstableCreateElement"])(document, attributes.content); // Remove any HTML tags
|
||||||
const div = document.createElement('div');
|
|
||||||
div.innerHTML = attributes.content;
|
|
||||||
const text = div.innerText || ''; // Get first url
|
|
||||||
|
|
||||||
const link = div.querySelector('a');
|
const text = element.innerText || ''; // Get first url
|
||||||
|
|
||||||
|
const link = element.querySelector('a');
|
||||||
const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block
|
const url = link === null || link === void 0 ? void 0 : link.getAttribute('href'); // Create singular button in the buttons block
|
||||||
|
|
||||||
return Object(external_wp_blocks_["createBlock"])('core/button', {
|
return Object(external_wp_blocks_["createBlock"])('core/button', {
|
||||||
|
@ -9694,10 +9701,9 @@ const buttons_transforms_transforms = {
|
||||||
})),
|
})),
|
||||||
isMatch: paragraphs => {
|
isMatch: paragraphs => {
|
||||||
return paragraphs.every(attributes => {
|
return paragraphs.every(attributes => {
|
||||||
const div = document.createElement('div');
|
const element = Object(external_wp_richText_["__unstableCreateElement"])(document, attributes.content);
|
||||||
div.innerHTML = attributes.content;
|
const text = element.innerText || '';
|
||||||
const text = div.innerText || '';
|
const links = element.querySelectorAll('a');
|
||||||
const links = div.querySelectorAll('a');
|
|
||||||
return text.length <= 30 && links.length <= 1;
|
return text.length <= 30 && links.length <= 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -19316,6 +19322,9 @@ const list_settings = {
|
||||||
save: list_save_save
|
save: list_save_save
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// EXTERNAL MODULE: external ["wp","dom"]
|
||||||
|
var external_wp_dom_ = __webpack_require__("1CF3");
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
|
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
|
||||||
|
|
||||||
|
|
||||||
|
@ -19329,6 +19338,7 @@ const list_settings = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function MissingBlockWarning({
|
function MissingBlockWarning({
|
||||||
attributes,
|
attributes,
|
||||||
convertToHTML
|
convertToHTML
|
||||||
|
@ -19361,7 +19371,7 @@ function MissingBlockWarning({
|
||||||
className: 'has-warning'
|
className: 'has-warning'
|
||||||
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
|
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
|
||||||
actions: actions
|
actions: actions
|
||||||
}, messageHTML), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, originalUndelimitedContent));
|
}, messageHTML), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(originalUndelimitedContent)));
|
||||||
}
|
}
|
||||||
|
|
||||||
const MissingEdit = Object(external_wp_data_["withDispatch"])((dispatch, {
|
const MissingEdit = Object(external_wp_data_["withDispatch"])((dispatch, {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -120,6 +120,7 @@ __webpack_require__.d(__webpack_exports__, "__unstableStripHTML", function() { r
|
||||||
__webpack_require__.d(__webpack_exports__, "isEmpty", function() { return /* reexport */ isEmpty; });
|
__webpack_require__.d(__webpack_exports__, "isEmpty", function() { return /* reexport */ isEmpty; });
|
||||||
__webpack_require__.d(__webpack_exports__, "removeInvalidHTML", function() { return /* reexport */ removeInvalidHTML; });
|
__webpack_require__.d(__webpack_exports__, "removeInvalidHTML", function() { return /* reexport */ removeInvalidHTML; });
|
||||||
__webpack_require__.d(__webpack_exports__, "isRTL", function() { return /* reexport */ isRTL; });
|
__webpack_require__.d(__webpack_exports__, "isRTL", function() { return /* reexport */ isRTL; });
|
||||||
|
__webpack_require__.d(__webpack_exports__, "safeHTML", function() { return /* reexport */ safeHTML; });
|
||||||
__webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return /* reexport */ getPhrasingContentSchema; });
|
__webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return /* reexport */ getPhrasingContentSchema; });
|
||||||
__webpack_require__.d(__webpack_exports__, "isPhrasingContent", function() { return /* reexport */ isPhrasingContent; });
|
__webpack_require__.d(__webpack_exports__, "isPhrasingContent", function() { return /* reexport */ isPhrasingContent; });
|
||||||
__webpack_require__.d(__webpack_exports__, "isTextContent", function() { return /* reexport */ isTextContent; });
|
__webpack_require__.d(__webpack_exports__, "isTextContent", function() { return /* reexport */ isTextContent; });
|
||||||
|
@ -1953,6 +1954,50 @@ function removeInvalidHTML(HTML, schema, inline) {
|
||||||
return doc.body.innerHTML;
|
return doc.body.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/safe-html.js
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Strips scripts and on* attributes from HTML.
|
||||||
|
*
|
||||||
|
* @param {string} html HTML to sanitize.
|
||||||
|
*
|
||||||
|
* @return {string} The sanitized HTML.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function safeHTML(html) {
|
||||||
|
const {
|
||||||
|
body
|
||||||
|
} = document.implementation.createHTMLDocument('');
|
||||||
|
body.innerHTML = html;
|
||||||
|
const elements = body.getElementsByTagName('*');
|
||||||
|
let elementIndex = elements.length;
|
||||||
|
|
||||||
|
while (elementIndex--) {
|
||||||
|
const element = elements[elementIndex];
|
||||||
|
|
||||||
|
if (element.tagName === 'SCRIPT') {
|
||||||
|
remove(element);
|
||||||
|
} else {
|
||||||
|
let attributeIndex = element.attributes.length;
|
||||||
|
|
||||||
|
while (attributeIndex--) {
|
||||||
|
const {
|
||||||
|
name: key
|
||||||
|
} = element.attributes[attributeIndex];
|
||||||
|
|
||||||
|
if (key.startsWith('on')) {
|
||||||
|
element.removeAttribute(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return body.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/index.js
|
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/index.js
|
||||||
|
|
||||||
|
|
||||||
|
@ -1977,6 +2022,7 @@ function removeInvalidHTML(HTML, schema, inline) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/data-transfer.js
|
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/data-transfer.js
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1274,6 +1274,22 @@ function createFromElement({
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === 'script') {
|
||||||
|
const value = {
|
||||||
|
formats: [,],
|
||||||
|
replacements: [{
|
||||||
|
type,
|
||||||
|
attributes: {
|
||||||
|
'data-rich-text-script': node.getAttribute('data-rich-text-script') || encodeURIComponent(node.innerHTML)
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
text: OBJECT_REPLACEMENT_CHARACTER
|
||||||
|
};
|
||||||
|
accumulateSelection(accumulator, node, range, value);
|
||||||
|
mergePair(accumulator, value);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (type === 'br') {
|
if (type === 'br') {
|
||||||
accumulateSelection(accumulator, node, range, createEmptyValue());
|
accumulateSelection(accumulator, node, range, createEmptyValue());
|
||||||
mergePair(accumulator, create({
|
mergePair(accumulator, create({
|
||||||
|
@ -1452,8 +1468,9 @@ function getAttributes({
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const safeName = /^on/i.test(name) ? 'data-disable-rich-text-' + name : name;
|
||||||
accumulator = accumulator || {};
|
accumulator = accumulator || {};
|
||||||
accumulator[name] = value;
|
accumulator[safeName] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return accumulator;
|
return accumulator;
|
||||||
|
@ -2437,6 +2454,26 @@ function get_format_type_getFormatType(name) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function restoreOnAttributes(attributes, isEditableTree) {
|
||||||
|
if (isEditableTree) {
|
||||||
|
return attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newAttributes = {};
|
||||||
|
|
||||||
|
for (const key in attributes) {
|
||||||
|
let newKey = key;
|
||||||
|
|
||||||
|
if (key.startsWith('data-disable-rich-text-')) {
|
||||||
|
newKey = key.slice('data-disable-rich-text-'.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
newAttributes[newKey] = attributes[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return newAttributes;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Converts a format object to information that can be used to create an element
|
* Converts a format object to information that can be used to create an element
|
||||||
* from (type, attributes and object).
|
* from (type, attributes and object).
|
||||||
|
@ -2450,16 +2487,20 @@ function get_format_type_getFormatType(name) {
|
||||||
* format.
|
* format.
|
||||||
* @param {boolean} $1.boundaryClass Whether or not to apply a boundary
|
* @param {boolean} $1.boundaryClass Whether or not to apply a boundary
|
||||||
* class.
|
* class.
|
||||||
|
* @param {boolean} $1.isEditableTree
|
||||||
|
*
|
||||||
* @return {Object} Information to be used for
|
* @return {Object} Information to be used for
|
||||||
* element creation.
|
* element creation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function fromFormat({
|
function fromFormat({
|
||||||
type,
|
type,
|
||||||
attributes,
|
attributes,
|
||||||
unregisteredAttributes,
|
unregisteredAttributes,
|
||||||
object,
|
object,
|
||||||
boundaryClass
|
boundaryClass,
|
||||||
|
isEditableTree
|
||||||
}) {
|
}) {
|
||||||
const formatType = get_format_type_getFormatType(type);
|
const formatType = get_format_type_getFormatType(type);
|
||||||
let elementAttributes = {};
|
let elementAttributes = {};
|
||||||
|
@ -2477,7 +2518,7 @@ function fromFormat({
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
attributes: elementAttributes,
|
attributes: restoreOnAttributes(elementAttributes, isEditableTree),
|
||||||
object
|
object
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2507,7 +2548,7 @@ function fromFormat({
|
||||||
return {
|
return {
|
||||||
type: formatType.tagName,
|
type: formatType.tagName,
|
||||||
object: formatType.object,
|
object: formatType.object,
|
||||||
attributes: elementAttributes
|
attributes: restoreOnAttributes(elementAttributes, isEditableTree)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -2642,7 +2683,8 @@ function toTree({
|
||||||
type,
|
type,
|
||||||
attributes,
|
attributes,
|
||||||
unregisteredAttributes,
|
unregisteredAttributes,
|
||||||
boundaryClass
|
boundaryClass,
|
||||||
|
isEditableTree
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (isText(pointer) && getText(pointer).length === 0) {
|
if (isText(pointer) && getText(pointer).length === 0) {
|
||||||
|
@ -2672,9 +2714,21 @@ function toTree({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character === OBJECT_REPLACEMENT_CHARACTER) {
|
if (character === OBJECT_REPLACEMENT_CHARACTER) {
|
||||||
pointer = append(getParent(pointer), fromFormat({ ...replacements[i],
|
if (!isEditableTree && replacements[i].type === 'script') {
|
||||||
object: true
|
pointer = append(getParent(pointer), fromFormat({
|
||||||
})); // Ensure pointer is text node.
|
type: 'script',
|
||||||
|
isEditableTree
|
||||||
|
}));
|
||||||
|
append(pointer, {
|
||||||
|
html: decodeURIComponent(replacements[i].attributes['data-rich-text-script'])
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
pointer = append(getParent(pointer), fromFormat({ ...replacements[i],
|
||||||
|
object: true,
|
||||||
|
isEditableTree
|
||||||
|
}));
|
||||||
|
} // Ensure pointer is text node.
|
||||||
|
|
||||||
|
|
||||||
pointer = append(getParent(pointer), '');
|
pointer = append(getParent(pointer), '');
|
||||||
} else if (!preserveWhiteSpace && character === '\n') {
|
} else if (!preserveWhiteSpace && character === '\n') {
|
||||||
|
@ -3189,6 +3243,10 @@ function createElementHTML({
|
||||||
|
|
||||||
function createChildrenHTML(children = []) {
|
function createChildrenHTML(children = []) {
|
||||||
return children.map(child => {
|
return children.map(child => {
|
||||||
|
if (child.html !== undefined) {
|
||||||
|
return child.html;
|
||||||
|
}
|
||||||
|
|
||||||
return child.text === undefined ? createElementHTML(child) : Object(external_wp_escapeHtml_["escapeEditableHTML"])(child.text);
|
return child.text === undefined ? createElementHTML(child) : Object(external_wp_escapeHtml_["escapeEditableHTML"])(child.text);
|
||||||
}).join('');
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-51425';
|
$wp_version = '5.9-alpha-51426';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue