Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
return '*';
[6500] Fix | Delete
}
[6501] Fix | Delete
[6502] Fix | Delete
return raw_handling_utils_objectSpread(raw_handling_utils_objectSpread({}, objValue), srcValue);
[6503] Fix | Delete
}
[6504] Fix | Delete
[6505] Fix | Delete
case 'attributes':
[6506] Fix | Delete
case 'require':
[6507] Fix | Delete
{
[6508] Fix | Delete
return [].concat(Object(toConsumableArray["a" /* default */])(objValue || []), Object(toConsumableArray["a" /* default */])(srcValue || []));
[6509] Fix | Delete
}
[6510] Fix | Delete
[6511] Fix | Delete
case 'isMatch':
[6512] Fix | Delete
{
[6513] Fix | Delete
// If one of the values being merge is undefined (matches everything),
[6514] Fix | Delete
// the result of the merge will be undefined.
[6515] Fix | Delete
if (!objValue || !srcValue) {
[6516] Fix | Delete
return undefined;
[6517] Fix | Delete
} // When merging two isMatch functions, the result is a new function
[6518] Fix | Delete
// that returns if one of the source functions returns true.
[6519] Fix | Delete
[6520] Fix | Delete
[6521] Fix | Delete
return function () {
[6522] Fix | Delete
return objValue.apply(void 0, arguments) || srcValue.apply(void 0, arguments);
[6523] Fix | Delete
};
[6524] Fix | Delete
}
[6525] Fix | Delete
}
[6526] Fix | Delete
}]));
[6527] Fix | Delete
}
[6528] Fix | Delete
/**
[6529] Fix | Delete
* Gets the block content schema, which is extracted and merged from all
[6530] Fix | Delete
* registered blocks with raw transfroms.
[6531] Fix | Delete
*
[6532] Fix | Delete
* @param {string} context Set to "paste" when in paste context, where the
[6533] Fix | Delete
* schema is more strict.
[6534] Fix | Delete
*
[6535] Fix | Delete
* @return {Object} A complete block content schema.
[6536] Fix | Delete
*/
[6537] Fix | Delete
[6538] Fix | Delete
function getBlockContentSchema(context) {
[6539] Fix | Delete
return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
[6540] Fix | Delete
}
[6541] Fix | Delete
/**
[6542] Fix | Delete
* Checks whether HTML can be considered plain text. That is, it does not contain
[6543] Fix | Delete
* any elements that are not line breaks.
[6544] Fix | Delete
*
[6545] Fix | Delete
* @param {string} HTML The HTML to check.
[6546] Fix | Delete
*
[6547] Fix | Delete
* @return {boolean} Whether the HTML can be considered plain text.
[6548] Fix | Delete
*/
[6549] Fix | Delete
[6550] Fix | Delete
function isPlain(HTML) {
[6551] Fix | Delete
return !/<(?!br[ />])/i.test(HTML);
[6552] Fix | Delete
}
[6553] Fix | Delete
/**
[6554] Fix | Delete
* Given node filters, deeply filters and mutates a NodeList.
[6555] Fix | Delete
*
[6556] Fix | Delete
* @param {NodeList} nodeList The nodeList to filter.
[6557] Fix | Delete
* @param {Array} filters An array of functions that can mutate with the provided node.
[6558] Fix | Delete
* @param {Document} doc The document of the nodeList.
[6559] Fix | Delete
* @param {Object} schema The schema to use.
[6560] Fix | Delete
*/
[6561] Fix | Delete
[6562] Fix | Delete
function deepFilterNodeList(nodeList, filters, doc, schema) {
[6563] Fix | Delete
Array.from(nodeList).forEach(function (node) {
[6564] Fix | Delete
deepFilterNodeList(node.childNodes, filters, doc, schema);
[6565] Fix | Delete
filters.forEach(function (item) {
[6566] Fix | Delete
// Make sure the node is still attached to the document.
[6567] Fix | Delete
if (!doc.contains(node)) {
[6568] Fix | Delete
return;
[6569] Fix | Delete
}
[6570] Fix | Delete
[6571] Fix | Delete
item(node, doc, schema);
[6572] Fix | Delete
});
[6573] Fix | Delete
});
[6574] Fix | Delete
}
[6575] Fix | Delete
/**
[6576] Fix | Delete
* Given node filters, deeply filters HTML tags.
[6577] Fix | Delete
* Filters from the deepest nodes to the top.
[6578] Fix | Delete
*
[6579] Fix | Delete
* @param {string} HTML The HTML to filter.
[6580] Fix | Delete
* @param {Array} filters An array of functions that can mutate with the provided node.
[6581] Fix | Delete
* @param {Object} schema The schema to use.
[6582] Fix | Delete
*
[6583] Fix | Delete
* @return {string} The filtered HTML.
[6584] Fix | Delete
*/
[6585] Fix | Delete
[6586] Fix | Delete
function deepFilterHTML(HTML) {
[6587] Fix | Delete
var filters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
[6588] Fix | Delete
var schema = arguments.length > 2 ? arguments[2] : undefined;
[6589] Fix | Delete
var doc = document.implementation.createHTMLDocument('');
[6590] Fix | Delete
doc.body.innerHTML = HTML;
[6591] Fix | Delete
deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
[6592] Fix | Delete
return doc.body.innerHTML;
[6593] Fix | Delete
}
[6594] Fix | Delete
/**
[6595] Fix | Delete
* Gets a sibling within text-level context.
[6596] Fix | Delete
*
[6597] Fix | Delete
* @param {Element} node The subject node.
[6598] Fix | Delete
* @param {string} which "next" or "previous".
[6599] Fix | Delete
*/
[6600] Fix | Delete
[6601] Fix | Delete
function getSibling(node, which) {
[6602] Fix | Delete
var sibling = node["".concat(which, "Sibling")];
[6603] Fix | Delete
[6604] Fix | Delete
if (sibling && Object(external_wp_dom_["isPhrasingContent"])(sibling)) {
[6605] Fix | Delete
return sibling;
[6606] Fix | Delete
}
[6607] Fix | Delete
[6608] Fix | Delete
var parentNode = node.parentNode;
[6609] Fix | Delete
[6610] Fix | Delete
if (!parentNode || !Object(external_wp_dom_["isPhrasingContent"])(parentNode)) {
[6611] Fix | Delete
return;
[6612] Fix | Delete
}
[6613] Fix | Delete
[6614] Fix | Delete
return getSibling(parentNode, which);
[6615] Fix | Delete
}
[6616] Fix | Delete
[6617] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js
[6618] Fix | Delete
/**
[6619] Fix | Delete
* Internal dependencies
[6620] Fix | Delete
*/
[6621] Fix | Delete
[6622] Fix | Delete
[6623] Fix | Delete
function isFormattingSpace(character) {
[6624] Fix | Delete
return character === ' ' || character === '\r' || character === '\n' || character === '\t';
[6625] Fix | Delete
}
[6626] Fix | Delete
/**
[6627] Fix | Delete
* Removes spacing that formats HTML.
[6628] Fix | Delete
*
[6629] Fix | Delete
* @see https://www.w3.org/TR/css-text-3/#white-space-processing
[6630] Fix | Delete
*
[6631] Fix | Delete
* @param {Node} node The node to be processed.
[6632] Fix | Delete
* @return {void}
[6633] Fix | Delete
*/
[6634] Fix | Delete
[6635] Fix | Delete
[6636] Fix | Delete
function htmlFormattingRemover(node) {
[6637] Fix | Delete
if (node.nodeType !== node.TEXT_NODE) {
[6638] Fix | Delete
return;
[6639] Fix | Delete
} // Ignore pre content. Note that this does not use Element#closest due to
[6640] Fix | Delete
// a combination of (a) node may not be Element and (b) node.parentElement
[6641] Fix | Delete
// does not have full support in all browsers (Internet Exporer).
[6642] Fix | Delete
//
[6643] Fix | Delete
// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement#Browser_compatibility
[6644] Fix | Delete
[6645] Fix | Delete
/** @type {Node?} */
[6646] Fix | Delete
[6647] Fix | Delete
[6648] Fix | Delete
var parent = node;
[6649] Fix | Delete
[6650] Fix | Delete
while (parent = parent.parentNode) {
[6651] Fix | Delete
if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === 'PRE') {
[6652] Fix | Delete
return;
[6653] Fix | Delete
}
[6654] Fix | Delete
} // First, replace any sequence of HTML formatting space with a single space.
[6655] Fix | Delete
[6656] Fix | Delete
[6657] Fix | Delete
var newData = node.data.replace(/[ \r\n\t]+/g, ' '); // Remove the leading space if the text element is at the start of a block,
[6658] Fix | Delete
// is preceded by a line break element, or has a space in the previous
[6659] Fix | Delete
// node.
[6660] Fix | Delete
[6661] Fix | Delete
if (newData[0] === ' ') {
[6662] Fix | Delete
var previousSibling = getSibling(node, 'previous');
[6663] Fix | Delete
[6664] Fix | Delete
if (!previousSibling || previousSibling.nodeName === 'BR' || previousSibling.textContent.slice(-1) === ' ') {
[6665] Fix | Delete
newData = newData.slice(1);
[6666] Fix | Delete
}
[6667] Fix | Delete
} // Remove the trailing space if the text element is at the end of a block,
[6668] Fix | Delete
// is succeded by a line break element, or has a space in the next text
[6669] Fix | Delete
// node.
[6670] Fix | Delete
[6671] Fix | Delete
[6672] Fix | Delete
if (newData[newData.length - 1] === ' ') {
[6673] Fix | Delete
var nextSibling = getSibling(node, 'next');
[6674] Fix | Delete
[6675] Fix | Delete
if (!nextSibling || nextSibling.nodeName === 'BR' || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
[6676] Fix | Delete
newData = newData.slice(0, -1);
[6677] Fix | Delete
}
[6678] Fix | Delete
} // If there's no data left, remove the node, so `previousSibling` stays
[6679] Fix | Delete
// accurate. Otherwise, update the node data.
[6680] Fix | Delete
[6681] Fix | Delete
[6682] Fix | Delete
if (!newData) {
[6683] Fix | Delete
node.parentNode.removeChild(node);
[6684] Fix | Delete
} else {
[6685] Fix | Delete
node.data = newData;
[6686] Fix | Delete
}
[6687] Fix | Delete
}
[6688] Fix | Delete
[6689] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js
[6690] Fix | Delete
/**
[6691] Fix | Delete
* Internal dependencies
[6692] Fix | Delete
*/
[6693] Fix | Delete
[6694] Fix | Delete
/**
[6695] Fix | Delete
* Removes trailing br elements from text-level content.
[6696] Fix | Delete
*
[6697] Fix | Delete
* @param {Element} node Node to check.
[6698] Fix | Delete
*/
[6699] Fix | Delete
[6700] Fix | Delete
function brRemover(node) {
[6701] Fix | Delete
if (node.nodeName !== 'BR') {
[6702] Fix | Delete
return;
[6703] Fix | Delete
}
[6704] Fix | Delete
[6705] Fix | Delete
if (getSibling(node, 'next')) {
[6706] Fix | Delete
return;
[6707] Fix | Delete
}
[6708] Fix | Delete
[6709] Fix | Delete
node.parentNode.removeChild(node);
[6710] Fix | Delete
}
[6711] Fix | Delete
[6712] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js
[6713] Fix | Delete
/**
[6714] Fix | Delete
* Removes empty paragraph elements.
[6715] Fix | Delete
*
[6716] Fix | Delete
* @param {Element} node Node to check.
[6717] Fix | Delete
*/
[6718] Fix | Delete
function emptyParagraphRemover(node) {
[6719] Fix | Delete
if (node.nodeName !== 'P') {
[6720] Fix | Delete
return;
[6721] Fix | Delete
}
[6722] Fix | Delete
[6723] Fix | Delete
if (node.hasChildNodes()) {
[6724] Fix | Delete
return;
[6725] Fix | Delete
}
[6726] Fix | Delete
[6727] Fix | Delete
node.parentNode.removeChild(node);
[6728] Fix | Delete
}
[6729] Fix | Delete
[6730] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
[6731] Fix | Delete
[6732] Fix | Delete
[6733] Fix | Delete
function paste_handler_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[6734] Fix | Delete
[6735] Fix | Delete
function paste_handler_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { paste_handler_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { paste_handler_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[6736] Fix | Delete
[6737] Fix | Delete
/**
[6738] Fix | Delete
* External dependencies
[6739] Fix | Delete
*/
[6740] Fix | Delete
[6741] Fix | Delete
/**
[6742] Fix | Delete
* WordPress dependencies
[6743] Fix | Delete
*/
[6744] Fix | Delete
[6745] Fix | Delete
[6746] Fix | Delete
/**
[6747] Fix | Delete
* Internal dependencies
[6748] Fix | Delete
*/
[6749] Fix | Delete
[6750] Fix | Delete
[6751] Fix | Delete
[6752] Fix | Delete
[6753] Fix | Delete
[6754] Fix | Delete
[6755] Fix | Delete
[6756] Fix | Delete
[6757] Fix | Delete
[6758] Fix | Delete
[6759] Fix | Delete
[6760] Fix | Delete
[6761] Fix | Delete
[6762] Fix | Delete
[6763] Fix | Delete
[6764] Fix | Delete
[6765] Fix | Delete
[6766] Fix | Delete
[6767] Fix | Delete
[6768] Fix | Delete
[6769] Fix | Delete
[6770] Fix | Delete
[6771] Fix | Delete
[6772] Fix | Delete
[6773] Fix | Delete
/**
[6774] Fix | Delete
* Browser dependencies
[6775] Fix | Delete
*/
[6776] Fix | Delete
[6777] Fix | Delete
var paste_handler_window = window,
[6778] Fix | Delete
paste_handler_console = paste_handler_window.console;
[6779] Fix | Delete
/**
[6780] Fix | Delete
* Filters HTML to only contain phrasing content.
[6781] Fix | Delete
*
[6782] Fix | Delete
* @param {string} HTML The HTML to filter.
[6783] Fix | Delete
* @param {boolean} preserveWhiteSpace Whether or not to preserve consequent white space.
[6784] Fix | Delete
*
[6785] Fix | Delete
* @return {string} HTML only containing phrasing content.
[6786] Fix | Delete
*/
[6787] Fix | Delete
[6788] Fix | Delete
function filterInlineHTML(HTML, preserveWhiteSpace) {
[6789] Fix | Delete
HTML = deepFilterHTML(HTML, [googleDocsUIdRemover, phrasingContentReducer, commentRemover]);
[6790] Fix | Delete
HTML = Object(external_wp_dom_["removeInvalidHTML"])(HTML, Object(external_wp_dom_["getPhrasingContentSchema"])('paste'), {
[6791] Fix | Delete
inline: true
[6792] Fix | Delete
});
[6793] Fix | Delete
[6794] Fix | Delete
if (!preserveWhiteSpace) {
[6795] Fix | Delete
HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
[6796] Fix | Delete
} // Allows us to ask for this information when we get a report.
[6797] Fix | Delete
[6798] Fix | Delete
[6799] Fix | Delete
paste_handler_console.log('Processed inline HTML:\n\n', HTML);
[6800] Fix | Delete
return HTML;
[6801] Fix | Delete
}
[6802] Fix | Delete
/**
[6803] Fix | Delete
* Converts an HTML string to known blocks. Strips everything else.
[6804] Fix | Delete
*
[6805] Fix | Delete
* @param {Object} options
[6806] Fix | Delete
* @param {string} [options.HTML] The HTML to convert.
[6807] Fix | Delete
* @param {string} [options.plainText] Plain text version.
[6808] Fix | Delete
* @param {string} [options.mode] Handle content as blocks or inline content.
[6809] Fix | Delete
* * 'AUTO': Decide based on the content passed.
[6810] Fix | Delete
* * 'INLINE': Always handle as inline content, and return string.
[6811] Fix | Delete
* * 'BLOCKS': Always handle as blocks, and return array of blocks.
[6812] Fix | Delete
* @param {Array} [options.tagName] The tag into which content will be inserted.
[6813] Fix | Delete
* @param {boolean} [options.preserveWhiteSpace] Whether or not to preserve consequent white space.
[6814] Fix | Delete
*
[6815] Fix | Delete
* @return {Array|string} A list of blocks or a string, depending on `handlerMode`.
[6816] Fix | Delete
*/
[6817] Fix | Delete
[6818] Fix | Delete
[6819] Fix | Delete
function pasteHandler(_ref) {
[6820] Fix | Delete
var _ref$HTML = _ref.HTML,
[6821] Fix | Delete
HTML = _ref$HTML === void 0 ? '' : _ref$HTML,
[6822] Fix | Delete
_ref$plainText = _ref.plainText,
[6823] Fix | Delete
plainText = _ref$plainText === void 0 ? '' : _ref$plainText,
[6824] Fix | Delete
_ref$mode = _ref.mode,
[6825] Fix | Delete
mode = _ref$mode === void 0 ? 'AUTO' : _ref$mode,
[6826] Fix | Delete
tagName = _ref.tagName,
[6827] Fix | Delete
preserveWhiteSpace = _ref.preserveWhiteSpace;
[6828] Fix | Delete
// First of all, strip any meta tags.
[6829] Fix | Delete
HTML = HTML.replace(/<meta[^>]+>/g, ''); // Strip Windows markers.
[6830] Fix | Delete
[6831] Fix | Delete
HTML = HTML.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, '');
[6832] Fix | Delete
HTML = HTML.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, ''); // If we detect block delimiters in HTML, parse entirely as blocks.
[6833] Fix | Delete
[6834] Fix | Delete
if (mode !== 'INLINE') {
[6835] Fix | Delete
// Check plain text if there is no HTML.
[6836] Fix | Delete
var content = HTML ? HTML : plainText;
[6837] Fix | Delete
[6838] Fix | Delete
if (content.indexOf('<!-- wp:') !== -1) {
[6839] Fix | Delete
return parseWithGrammar(content);
[6840] Fix | Delete
}
[6841] Fix | Delete
} // Normalize unicode to use composed characters.
[6842] Fix | Delete
// This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
[6843] Fix | Delete
// Not normalizing the content will only affect older browsers and won't
[6844] Fix | Delete
// entirely break the app.
[6845] Fix | Delete
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
[6846] Fix | Delete
// See: https://core.trac.wordpress.org/ticket/30130
[6847] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/6983#pullrequestreview-125151075
[6848] Fix | Delete
[6849] Fix | Delete
[6850] Fix | Delete
if (String.prototype.normalize) {
[6851] Fix | Delete
HTML = HTML.normalize();
[6852] Fix | Delete
} // Parse Markdown (and encoded HTML) if:
[6853] Fix | Delete
// * There is a plain text version.
[6854] Fix | Delete
// * There is no HTML version, or it has no formatting.
[6855] Fix | Delete
[6856] Fix | Delete
[6857] Fix | Delete
if (plainText && (!HTML || isPlain(HTML))) {
[6858] Fix | Delete
HTML = markdownConverter(plainText); // Switch to inline mode if:
[6859] Fix | Delete
// * The current mode is AUTO.
[6860] Fix | Delete
// * The original plain text had no line breaks.
[6861] Fix | Delete
// * The original plain text was not an HTML paragraph.
[6862] Fix | Delete
// * The converted text is just a paragraph.
[6863] Fix | Delete
[6864] Fix | Delete
if (mode === 'AUTO' && plainText.indexOf('\n') === -1 && plainText.indexOf('<p>') !== 0 && HTML.indexOf('<p>') === 0) {
[6865] Fix | Delete
mode = 'INLINE';
[6866] Fix | Delete
}
[6867] Fix | Delete
}
[6868] Fix | Delete
[6869] Fix | Delete
if (mode === 'INLINE') {
[6870] Fix | Delete
return filterInlineHTML(HTML, preserveWhiteSpace);
[6871] Fix | Delete
} // An array of HTML strings and block objects. The blocks replace matched
[6872] Fix | Delete
// shortcodes.
[6873] Fix | Delete
[6874] Fix | Delete
[6875] Fix | Delete
var pieces = shortcode_converter(HTML); // The call to shortcodeConverter will always return more than one element
[6876] Fix | Delete
// if shortcodes are matched. The reason is when shortcodes are matched
[6877] Fix | Delete
// empty HTML strings are included.
[6878] Fix | Delete
[6879] Fix | Delete
var hasShortcodes = pieces.length > 1;
[6880] Fix | Delete
[6881] Fix | Delete
if (mode === 'AUTO' && !hasShortcodes && isInlineContent(HTML, tagName)) {
[6882] Fix | Delete
return filterInlineHTML(HTML, preserveWhiteSpace);
[6883] Fix | Delete
}
[6884] Fix | Delete
[6885] Fix | Delete
var phrasingContentSchema = Object(external_wp_dom_["getPhrasingContentSchema"])('paste');
[6886] Fix | Delete
var blockContentSchema = getBlockContentSchema('paste');
[6887] Fix | Delete
var blocks = Object(external_lodash_["compact"])(Object(external_lodash_["flatMap"])(pieces, function (piece) {
[6888] Fix | Delete
// Already a block from shortcode.
[6889] Fix | Delete
if (typeof piece !== 'string') {
[6890] Fix | Delete
return piece;
[6891] Fix | Delete
}
[6892] Fix | Delete
[6893] Fix | Delete
var filters = [googleDocsUIdRemover, msListConverter, headRemover, listReducer, imageCorrector, phrasingContentReducer, specialCommentConverter, commentRemover, iframeRemover, figureContentReducer, blockquoteNormaliser];
[6894] Fix | Delete
[6895] Fix | Delete
var schema = paste_handler_objectSpread(paste_handler_objectSpread({}, blockContentSchema), phrasingContentSchema);
[6896] Fix | Delete
[6897] Fix | Delete
piece = deepFilterHTML(piece, filters, blockContentSchema);
[6898] Fix | Delete
piece = Object(external_wp_dom_["removeInvalidHTML"])(piece, schema);
[6899] Fix | Delete
piece = normaliseBlocks(piece);
[6900] Fix | Delete
piece = deepFilterHTML(piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema); // Allows us to ask for this information when we get a report.
[6901] Fix | Delete
[6902] Fix | Delete
paste_handler_console.log('Processed HTML piece:\n\n', piece);
[6903] Fix | Delete
return htmlToBlocks(piece);
[6904] Fix | Delete
})); // If we're allowed to return inline content, and there is only one inlineable block,
[6905] Fix | Delete
// and the original plain text content does not have any line breaks, then
[6906] Fix | Delete
// treat it as inline paste.
[6907] Fix | Delete
[6908] Fix | Delete
if (mode === 'AUTO' && blocks.length === 1 && registration_hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
[6909] Fix | Delete
var trimmedPlainText = plainText.trim();
[6910] Fix | Delete
[6911] Fix | Delete
if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
[6912] Fix | Delete
return Object(external_wp_dom_["removeInvalidHTML"])(getBlockContent(blocks[0]), phrasingContentSchema);
[6913] Fix | Delete
}
[6914] Fix | Delete
}
[6915] Fix | Delete
[6916] Fix | Delete
return blocks;
[6917] Fix | Delete
}
[6918] Fix | Delete
[6919] Fix | Delete
// EXTERNAL MODULE: external ["wp","deprecated"]
[6920] Fix | Delete
var external_wp_deprecated_ = __webpack_require__("NMb1");
[6921] Fix | Delete
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
[6922] Fix | Delete
[6923] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js
[6924] Fix | Delete
/**
[6925] Fix | Delete
* External dependencies
[6926] Fix | Delete
*/
[6927] Fix | Delete
[6928] Fix | Delete
/**
[6929] Fix | Delete
* WordPress dependencies
[6930] Fix | Delete
*/
[6931] Fix | Delete
[6932] Fix | Delete
[6933] Fix | Delete
[6934] Fix | Delete
/**
[6935] Fix | Delete
* Internal dependencies
[6936] Fix | Delete
*/
[6937] Fix | Delete
[6938] Fix | Delete
[6939] Fix | Delete
[6940] Fix | Delete
[6941] Fix | Delete
[6942] Fix | Delete
[6943] Fix | Delete
[6944] Fix | Delete
[6945] Fix | Delete
[6946] Fix | Delete
[6947] Fix | Delete
[6948] Fix | Delete
function deprecatedGetPhrasingContentSchema(context) {
[6949] Fix | Delete
external_wp_deprecated_default()('wp.blocks.getPhrasingContentSchema', {
[6950] Fix | Delete
alternative: 'wp.dom.getPhrasingContentSchema'
[6951] Fix | Delete
});
[6952] Fix | Delete
return Object(external_wp_dom_["getPhrasingContentSchema"])(context);
[6953] Fix | Delete
}
[6954] Fix | Delete
/**
[6955] Fix | Delete
* Converts an HTML string to known blocks.
[6956] Fix | Delete
*
[6957] Fix | Delete
* @param {Object} $1
[6958] Fix | Delete
* @param {string} $1.HTML The HTML to convert.
[6959] Fix | Delete
*
[6960] Fix | Delete
* @return {Array} A list of blocks.
[6961] Fix | Delete
*/
[6962] Fix | Delete
[6963] Fix | Delete
function rawHandler(_ref) {
[6964] Fix | Delete
var _ref$HTML = _ref.HTML,
[6965] Fix | Delete
HTML = _ref$HTML === void 0 ? '' : _ref$HTML;
[6966] Fix | Delete
[6967] Fix | Delete
// If we detect block delimiters, parse entirely as blocks.
[6968] Fix | Delete
if (HTML.indexOf('<!-- wp:') !== -1) {
[6969] Fix | Delete
return parseWithGrammar(HTML);
[6970] Fix | Delete
} // An array of HTML strings and block objects. The blocks replace matched
[6971] Fix | Delete
// shortcodes.
[6972] Fix | Delete
[6973] Fix | Delete
[6974] Fix | Delete
var pieces = shortcode_converter(HTML);
[6975] Fix | Delete
var blockContentSchema = getBlockContentSchema();
[6976] Fix | Delete
return Object(external_lodash_["compact"])(Object(external_lodash_["flatMap"])(pieces, function (piece) {
[6977] Fix | Delete
// Already a block from shortcode.
[6978] Fix | Delete
if (typeof piece !== 'string') {
[6979] Fix | Delete
return piece;
[6980] Fix | Delete
} // These filters are essential for some blocks to be able to transform
[6981] Fix | Delete
// from raw HTML. These filters move around some content or add
[6982] Fix | Delete
// additional tags, they do not remove any content.
[6983] Fix | Delete
[6984] Fix | Delete
[6985] Fix | Delete
var filters = [// Needed to adjust invalid lists.
[6986] Fix | Delete
listReducer, // Needed to create more and nextpage blocks.
[6987] Fix | Delete
specialCommentConverter, // Needed to create media blocks.
[6988] Fix | Delete
figureContentReducer, // Needed to create the quote block, which cannot handle text
[6989] Fix | Delete
// without wrapper paragraphs.
[6990] Fix | Delete
blockquoteNormaliser];
[6991] Fix | Delete
piece = deepFilterHTML(piece, filters, blockContentSchema);
[6992] Fix | Delete
piece = normaliseBlocks(piece);
[6993] Fix | Delete
return htmlToBlocks(piece);
[6994] Fix | Delete
}));
[6995] Fix | Delete
}
[6996] Fix | Delete
[6997] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/categories.js
[6998] Fix | Delete
/**
[6999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function