Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: blocks.js
}
[14000] Fix | Delete
return node;
[14001] Fix | Delete
}
[14002] Fix | Delete
function createNextpage(doc) {
[14003] Fix | Delete
const node = doc.createElement('wp-block');
[14004] Fix | Delete
node.dataset.block = 'core/nextpage';
[14005] Fix | Delete
return node;
[14006] Fix | Delete
}
[14007] Fix | Delete
[14008] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js
[14009] Fix | Delete
/**
[14010] Fix | Delete
* WordPress dependencies
[14011] Fix | Delete
*/
[14012] Fix | Delete
[14013] Fix | Delete
function isList(node) {
[14014] Fix | Delete
return node.nodeName === 'OL' || node.nodeName === 'UL';
[14015] Fix | Delete
}
[14016] Fix | Delete
function shallowTextContent(element) {
[14017] Fix | Delete
return Array.from(element.childNodes).map(({
[14018] Fix | Delete
nodeValue = ''
[14019] Fix | Delete
}) => nodeValue).join('');
[14020] Fix | Delete
}
[14021] Fix | Delete
function listReducer(node) {
[14022] Fix | Delete
if (!isList(node)) {
[14023] Fix | Delete
return;
[14024] Fix | Delete
}
[14025] Fix | Delete
const list = node;
[14026] Fix | Delete
const prevElement = node.previousElementSibling;
[14027] Fix | Delete
[14028] Fix | Delete
// Merge with previous list if:
[14029] Fix | Delete
// * There is a previous list of the same type.
[14030] Fix | Delete
// * There is only one list item.
[14031] Fix | Delete
if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
[14032] Fix | Delete
// Move all child nodes, including any text nodes, if any.
[14033] Fix | Delete
while (list.firstChild) {
[14034] Fix | Delete
prevElement.appendChild(list.firstChild);
[14035] Fix | Delete
}
[14036] Fix | Delete
list.parentNode.removeChild(list);
[14037] Fix | Delete
}
[14038] Fix | Delete
const parentElement = node.parentNode;
[14039] Fix | Delete
[14040] Fix | Delete
// Nested list with empty parent item.
[14041] Fix | Delete
if (parentElement && parentElement.nodeName === 'LI' && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
[14042] Fix | Delete
const parentListItem = parentElement;
[14043] Fix | Delete
const prevListItem = parentListItem.previousElementSibling;
[14044] Fix | Delete
const parentList = parentListItem.parentNode;
[14045] Fix | Delete
if (prevListItem) {
[14046] Fix | Delete
prevListItem.appendChild(list);
[14047] Fix | Delete
parentList.removeChild(parentListItem);
[14048] Fix | Delete
}
[14049] Fix | Delete
}
[14050] Fix | Delete
[14051] Fix | Delete
// Invalid: OL/UL > OL/UL.
[14052] Fix | Delete
if (parentElement && isList(parentElement)) {
[14053] Fix | Delete
const prevListItem = node.previousElementSibling;
[14054] Fix | Delete
if (prevListItem) {
[14055] Fix | Delete
prevListItem.appendChild(node);
[14056] Fix | Delete
} else {
[14057] Fix | Delete
(0,external_wp_dom_namespaceObject.unwrap)(node);
[14058] Fix | Delete
}
[14059] Fix | Delete
}
[14060] Fix | Delete
}
[14061] Fix | Delete
[14062] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js
[14063] Fix | Delete
/**
[14064] Fix | Delete
* Internal dependencies
[14065] Fix | Delete
*/
[14066] Fix | Delete
[14067] Fix | Delete
function blockquoteNormaliser(options) {
[14068] Fix | Delete
return node => {
[14069] Fix | Delete
if (node.nodeName !== 'BLOCKQUOTE') {
[14070] Fix | Delete
return;
[14071] Fix | Delete
}
[14072] Fix | Delete
node.innerHTML = normaliseBlocks(node.innerHTML, options);
[14073] Fix | Delete
};
[14074] Fix | Delete
}
[14075] Fix | Delete
[14076] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js
[14077] Fix | Delete
/**
[14078] Fix | Delete
* WordPress dependencies
[14079] Fix | Delete
*/
[14080] Fix | Delete
[14081] Fix | Delete
[14082] Fix | Delete
/**
[14083] Fix | Delete
* Whether or not the given node is figure content.
[14084] Fix | Delete
*
[14085] Fix | Delete
* @param {Node} node The node to check.
[14086] Fix | Delete
* @param {Object} schema The schema to use.
[14087] Fix | Delete
*
[14088] Fix | Delete
* @return {boolean} True if figure content, false if not.
[14089] Fix | Delete
*/
[14090] Fix | Delete
function isFigureContent(node, schema) {
[14091] Fix | Delete
var _schema$figure$childr;
[14092] Fix | Delete
const tag = node.nodeName.toLowerCase();
[14093] Fix | Delete
[14094] Fix | Delete
// We are looking for tags that can be a child of the figure tag, excluding
[14095] Fix | Delete
// `figcaption` and any phrasing content.
[14096] Fix | Delete
if (tag === 'figcaption' || (0,external_wp_dom_namespaceObject.isTextContent)(node)) {
[14097] Fix | Delete
return false;
[14098] Fix | Delete
}
[14099] Fix | Delete
return tag in ((_schema$figure$childr = schema?.figure?.children) !== null && _schema$figure$childr !== void 0 ? _schema$figure$childr : {});
[14100] Fix | Delete
}
[14101] Fix | Delete
[14102] Fix | Delete
/**
[14103] Fix | Delete
* Whether or not the given node can have an anchor.
[14104] Fix | Delete
*
[14105] Fix | Delete
* @param {Node} node The node to check.
[14106] Fix | Delete
* @param {Object} schema The schema to use.
[14107] Fix | Delete
*
[14108] Fix | Delete
* @return {boolean} True if it can, false if not.
[14109] Fix | Delete
*/
[14110] Fix | Delete
function canHaveAnchor(node, schema) {
[14111] Fix | Delete
var _schema$figure$childr2;
[14112] Fix | Delete
const tag = node.nodeName.toLowerCase();
[14113] Fix | Delete
return tag in ((_schema$figure$childr2 = schema?.figure?.children?.a?.children) !== null && _schema$figure$childr2 !== void 0 ? _schema$figure$childr2 : {});
[14114] Fix | Delete
}
[14115] Fix | Delete
[14116] Fix | Delete
/**
[14117] Fix | Delete
* Wraps the given element in a figure element.
[14118] Fix | Delete
*
[14119] Fix | Delete
* @param {Element} element The element to wrap.
[14120] Fix | Delete
* @param {Element} beforeElement The element before which to place the figure.
[14121] Fix | Delete
*/
[14122] Fix | Delete
function wrapFigureContent(element, beforeElement = element) {
[14123] Fix | Delete
const figure = element.ownerDocument.createElement('figure');
[14124] Fix | Delete
beforeElement.parentNode.insertBefore(figure, beforeElement);
[14125] Fix | Delete
figure.appendChild(element);
[14126] Fix | Delete
}
[14127] Fix | Delete
[14128] Fix | Delete
/**
[14129] Fix | Delete
* This filter takes figure content out of paragraphs, wraps it in a figure
[14130] Fix | Delete
* element, and moves any anchors with it if needed.
[14131] Fix | Delete
*
[14132] Fix | Delete
* @param {Node} node The node to filter.
[14133] Fix | Delete
* @param {Document} doc The document of the node.
[14134] Fix | Delete
* @param {Object} schema The schema to use.
[14135] Fix | Delete
*
[14136] Fix | Delete
* @return {void}
[14137] Fix | Delete
*/
[14138] Fix | Delete
function figureContentReducer(node, doc, schema) {
[14139] Fix | Delete
if (!isFigureContent(node, schema)) {
[14140] Fix | Delete
return;
[14141] Fix | Delete
}
[14142] Fix | Delete
let nodeToInsert = node;
[14143] Fix | Delete
const parentNode = node.parentNode;
[14144] Fix | Delete
[14145] Fix | Delete
// If the figure content can have an anchor and its parent is an anchor with
[14146] Fix | Delete
// only the figure content, take the anchor out instead of just the content.
[14147] Fix | Delete
if (canHaveAnchor(node, schema) && parentNode.nodeName === 'A' && parentNode.childNodes.length === 1) {
[14148] Fix | Delete
nodeToInsert = node.parentNode;
[14149] Fix | Delete
}
[14150] Fix | Delete
const wrapper = nodeToInsert.closest('p,div');
[14151] Fix | Delete
[14152] Fix | Delete
// If wrapped in a paragraph or div, only extract if it's aligned or if
[14153] Fix | Delete
// there is no text content.
[14154] Fix | Delete
// Otherwise, if directly at the root, wrap in a figure element.
[14155] Fix | Delete
if (wrapper) {
[14156] Fix | Delete
// In jsdom-jscore, 'node.classList' can be undefined.
[14157] Fix | Delete
// In this case, default to extract as it offers a better UI experience on mobile.
[14158] Fix | Delete
if (!node.classList) {
[14159] Fix | Delete
wrapFigureContent(nodeToInsert, wrapper);
[14160] Fix | Delete
} else if (node.classList.contains('alignright') || node.classList.contains('alignleft') || node.classList.contains('aligncenter') || !wrapper.textContent.trim()) {
[14161] Fix | Delete
wrapFigureContent(nodeToInsert, wrapper);
[14162] Fix | Delete
}
[14163] Fix | Delete
} else if (nodeToInsert.parentNode.nodeName === 'BODY') {
[14164] Fix | Delete
wrapFigureContent(nodeToInsert);
[14165] Fix | Delete
}
[14166] Fix | Delete
}
[14167] Fix | Delete
[14168] Fix | Delete
;// CONCATENATED MODULE: external ["wp","shortcode"]
[14169] Fix | Delete
const external_wp_shortcode_namespaceObject = window["wp"]["shortcode"];
[14170] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js
[14171] Fix | Delete
/**
[14172] Fix | Delete
* WordPress dependencies
[14173] Fix | Delete
*/
[14174] Fix | Delete
[14175] Fix | Delete
[14176] Fix | Delete
/**
[14177] Fix | Delete
* Internal dependencies
[14178] Fix | Delete
*/
[14179] Fix | Delete
[14180] Fix | Delete
[14181] Fix | Delete
[14182] Fix | Delete
[14183] Fix | Delete
const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
[14184] Fix | Delete
const beforeLineRegexp = /(\n|<p>)\s*$/;
[14185] Fix | Delete
const afterLineRegexp = /^\s*(\n|<\/p>)/;
[14186] Fix | Delete
function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
[14187] Fix | Delete
// Get all matches.
[14188] Fix | Delete
const transformsFrom = getBlockTransforms('from');
[14189] Fix | Delete
const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && castArray(transform.tag).some(tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML)));
[14190] Fix | Delete
if (!transformation) {
[14191] Fix | Delete
return [HTML];
[14192] Fix | Delete
}
[14193] Fix | Delete
const transformTags = castArray(transformation.tag);
[14194] Fix | Delete
const transformTag = transformTags.find(tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML));
[14195] Fix | Delete
let match;
[14196] Fix | Delete
const previousIndex = lastIndex;
[14197] Fix | Delete
if (match = (0,external_wp_shortcode_namespaceObject.next)(transformTag, HTML, lastIndex)) {
[14198] Fix | Delete
lastIndex = match.index + match.content.length;
[14199] Fix | Delete
const beforeHTML = HTML.substr(0, match.index);
[14200] Fix | Delete
const afterHTML = HTML.substr(lastIndex);
[14201] Fix | Delete
[14202] Fix | Delete
// If the shortcode content does not contain HTML and the shortcode is
[14203] Fix | Delete
// not on a new line (or in paragraph from Markdown converter),
[14204] Fix | Delete
// consider the shortcode as inline text, and thus skip conversion for
[14205] Fix | Delete
// this segment.
[14206] Fix | Delete
if (!match.shortcode.content?.includes('<') && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
[14207] Fix | Delete
return segmentHTMLToShortcodeBlock(HTML, lastIndex);
[14208] Fix | Delete
}
[14209] Fix | Delete
[14210] Fix | Delete
// If a transformation's `isMatch` predicate fails for the inbound
[14211] Fix | Delete
// shortcode, try again by excluding the current block type.
[14212] Fix | Delete
//
[14213] Fix | Delete
// This is the only call to `segmentHTMLToShortcodeBlock` that should
[14214] Fix | Delete
// ever carry over `excludedBlockNames`. Other calls in the module
[14215] Fix | Delete
// should skip that argument as a way to reset the exclusion state, so
[14216] Fix | Delete
// that one `isMatch` fail in an HTML fragment doesn't prevent any
[14217] Fix | Delete
// valid matches in subsequent fragments.
[14218] Fix | Delete
if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
[14219] Fix | Delete
return segmentHTMLToShortcodeBlock(HTML, previousIndex, [...excludedBlockNames, transformation.blockName]);
[14220] Fix | Delete
}
[14221] Fix | Delete
let blocks = [];
[14222] Fix | Delete
if (typeof transformation.transform === 'function') {
[14223] Fix | Delete
// Passing all of `match` as second argument is intentionally broad
[14224] Fix | Delete
// but shouldn't be too relied upon.
[14225] Fix | Delete
//
[14226] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
[14227] Fix | Delete
blocks = [].concat(transformation.transform(match.shortcode.attrs, match));
[14228] Fix | Delete
[14229] Fix | Delete
// Applying the built-in fixes can enhance the attributes with missing content like "className".
[14230] Fix | Delete
blocks = blocks.map(block => {
[14231] Fix | Delete
block.originalContent = match.shortcode.content;
[14232] Fix | Delete
return applyBuiltInValidationFixes(block, getBlockType(block.name));
[14233] Fix | Delete
});
[14234] Fix | Delete
} else {
[14235] Fix | Delete
const attributes = Object.fromEntries(Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode)
[14236] Fix | Delete
// Passing all of `match` as second argument is intentionally broad
[14237] Fix | Delete
// but shouldn't be too relied upon.
[14238] Fix | Delete
//
[14239] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
[14240] Fix | Delete
.map(([key, schema]) => [key, schema.shortcode(match.shortcode.attrs, match)]));
[14241] Fix | Delete
const blockType = getBlockType(transformation.blockName);
[14242] Fix | Delete
if (!blockType) {
[14243] Fix | Delete
return [HTML];
[14244] Fix | Delete
}
[14245] Fix | Delete
const transformationBlockType = {
[14246] Fix | Delete
...blockType,
[14247] Fix | Delete
attributes: transformation.attributes
[14248] Fix | Delete
};
[14249] Fix | Delete
let block = createBlock(transformation.blockName, getBlockAttributes(transformationBlockType, match.shortcode.content, attributes));
[14250] Fix | Delete
[14251] Fix | Delete
// Applying the built-in fixes can enhance the attributes with missing content like "className".
[14252] Fix | Delete
block.originalContent = match.shortcode.content;
[14253] Fix | Delete
block = applyBuiltInValidationFixes(block, transformationBlockType);
[14254] Fix | Delete
blocks = [block];
[14255] Fix | Delete
}
[14256] Fix | Delete
return [...segmentHTMLToShortcodeBlock(beforeHTML.replace(beforeLineRegexp, '')), ...blocks, ...segmentHTMLToShortcodeBlock(afterHTML.replace(afterLineRegexp, ''))];
[14257] Fix | Delete
}
[14258] Fix | Delete
return [HTML];
[14259] Fix | Delete
}
[14260] Fix | Delete
/* harmony default export */ const shortcode_converter = (segmentHTMLToShortcodeBlock);
[14261] Fix | Delete
[14262] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js
[14263] Fix | Delete
/**
[14264] Fix | Delete
* WordPress dependencies
[14265] Fix | Delete
*/
[14266] Fix | Delete
[14267] Fix | Delete
[14268] Fix | Delete
/**
[14269] Fix | Delete
* Internal dependencies
[14270] Fix | Delete
*/
[14271] Fix | Delete
[14272] Fix | Delete
[14273] Fix | Delete
function getBlockContentSchemaFromTransforms(transforms, context) {
[14274] Fix | Delete
const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context);
[14275] Fix | Delete
const schemaArgs = {
[14276] Fix | Delete
phrasingContentSchema,
[14277] Fix | Delete
isPaste: context === 'paste'
[14278] Fix | Delete
};
[14279] Fix | Delete
const schemas = transforms.map(({
[14280] Fix | Delete
isMatch,
[14281] Fix | Delete
blockName,
[14282] Fix | Delete
schema
[14283] Fix | Delete
}) => {
[14284] Fix | Delete
const hasAnchorSupport = hasBlockSupport(blockName, 'anchor');
[14285] Fix | Delete
schema = typeof schema === 'function' ? schema(schemaArgs) : schema;
[14286] Fix | Delete
[14287] Fix | Delete
// If the block does not has anchor support and the transform does not
[14288] Fix | Delete
// provides an isMatch we can return the schema right away.
[14289] Fix | Delete
if (!hasAnchorSupport && !isMatch) {
[14290] Fix | Delete
return schema;
[14291] Fix | Delete
}
[14292] Fix | Delete
if (!schema) {
[14293] Fix | Delete
return {};
[14294] Fix | Delete
}
[14295] Fix | Delete
return Object.fromEntries(Object.entries(schema).map(([key, value]) => {
[14296] Fix | Delete
let attributes = value.attributes || [];
[14297] Fix | Delete
// If the block supports the "anchor" functionality, it needs to keep its ID attribute.
[14298] Fix | Delete
if (hasAnchorSupport) {
[14299] Fix | Delete
attributes = [...attributes, 'id'];
[14300] Fix | Delete
}
[14301] Fix | Delete
return [key, {
[14302] Fix | Delete
...value,
[14303] Fix | Delete
attributes,
[14304] Fix | Delete
isMatch: isMatch ? isMatch : undefined
[14305] Fix | Delete
}];
[14306] Fix | Delete
}));
[14307] Fix | Delete
});
[14308] Fix | Delete
function mergeTagNameSchemaProperties(objValue, srcValue, key) {
[14309] Fix | Delete
switch (key) {
[14310] Fix | Delete
case 'children':
[14311] Fix | Delete
{
[14312] Fix | Delete
if (objValue === '*' || srcValue === '*') {
[14313] Fix | Delete
return '*';
[14314] Fix | Delete
}
[14315] Fix | Delete
return {
[14316] Fix | Delete
...objValue,
[14317] Fix | Delete
...srcValue
[14318] Fix | Delete
};
[14319] Fix | Delete
}
[14320] Fix | Delete
case 'attributes':
[14321] Fix | Delete
case 'require':
[14322] Fix | Delete
{
[14323] Fix | Delete
return [...(objValue || []), ...(srcValue || [])];
[14324] Fix | Delete
}
[14325] Fix | Delete
case 'isMatch':
[14326] Fix | Delete
{
[14327] Fix | Delete
// If one of the values being merge is undefined (matches everything),
[14328] Fix | Delete
// the result of the merge will be undefined.
[14329] Fix | Delete
if (!objValue || !srcValue) {
[14330] Fix | Delete
return undefined;
[14331] Fix | Delete
}
[14332] Fix | Delete
// When merging two isMatch functions, the result is a new function
[14333] Fix | Delete
// that returns if one of the source functions returns true.
[14334] Fix | Delete
return (...args) => {
[14335] Fix | Delete
return objValue(...args) || srcValue(...args);
[14336] Fix | Delete
};
[14337] Fix | Delete
}
[14338] Fix | Delete
}
[14339] Fix | Delete
}
[14340] Fix | Delete
[14341] Fix | Delete
// A tagName schema is an object with children, attributes, require, and
[14342] Fix | Delete
// isMatch properties.
[14343] Fix | Delete
function mergeTagNameSchemas(a, b) {
[14344] Fix | Delete
for (const key in b) {
[14345] Fix | Delete
a[key] = a[key] ? mergeTagNameSchemaProperties(a[key], b[key], key) : {
[14346] Fix | Delete
...b[key]
[14347] Fix | Delete
};
[14348] Fix | Delete
}
[14349] Fix | Delete
return a;
[14350] Fix | Delete
}
[14351] Fix | Delete
[14352] Fix | Delete
// A schema is an object with tagName schemas by tag name.
[14353] Fix | Delete
function mergeSchemas(a, b) {
[14354] Fix | Delete
for (const key in b) {
[14355] Fix | Delete
a[key] = a[key] ? mergeTagNameSchemas(a[key], b[key]) : {
[14356] Fix | Delete
...b[key]
[14357] Fix | Delete
};
[14358] Fix | Delete
}
[14359] Fix | Delete
return a;
[14360] Fix | Delete
}
[14361] Fix | Delete
return schemas.reduce(mergeSchemas, {});
[14362] Fix | Delete
}
[14363] Fix | Delete
[14364] Fix | Delete
/**
[14365] Fix | Delete
* Gets the block content schema, which is extracted and merged from all
[14366] Fix | Delete
* registered blocks with raw transfroms.
[14367] Fix | Delete
*
[14368] Fix | Delete
* @param {string} context Set to "paste" when in paste context, where the
[14369] Fix | Delete
* schema is more strict.
[14370] Fix | Delete
*
[14371] Fix | Delete
* @return {Object} A complete block content schema.
[14372] Fix | Delete
*/
[14373] Fix | Delete
function getBlockContentSchema(context) {
[14374] Fix | Delete
return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
[14375] Fix | Delete
}
[14376] Fix | Delete
[14377] Fix | Delete
/**
[14378] Fix | Delete
* Checks whether HTML can be considered plain text. That is, it does not contain
[14379] Fix | Delete
* any elements that are not line breaks.
[14380] Fix | Delete
*
[14381] Fix | Delete
* @param {string} HTML The HTML to check.
[14382] Fix | Delete
*
[14383] Fix | Delete
* @return {boolean} Whether the HTML can be considered plain text.
[14384] Fix | Delete
*/
[14385] Fix | Delete
function isPlain(HTML) {
[14386] Fix | Delete
return !/<(?!br[ />])/i.test(HTML);
[14387] Fix | Delete
}
[14388] Fix | Delete
[14389] Fix | Delete
/**
[14390] Fix | Delete
* Given node filters, deeply filters and mutates a NodeList.
[14391] Fix | Delete
*
[14392] Fix | Delete
* @param {NodeList} nodeList The nodeList to filter.
[14393] Fix | Delete
* @param {Array} filters An array of functions that can mutate with the provided node.
[14394] Fix | Delete
* @param {Document} doc The document of the nodeList.
[14395] Fix | Delete
* @param {Object} schema The schema to use.
[14396] Fix | Delete
*/
[14397] Fix | Delete
function deepFilterNodeList(nodeList, filters, doc, schema) {
[14398] Fix | Delete
Array.from(nodeList).forEach(node => {
[14399] Fix | Delete
deepFilterNodeList(node.childNodes, filters, doc, schema);
[14400] Fix | Delete
filters.forEach(item => {
[14401] Fix | Delete
// Make sure the node is still attached to the document.
[14402] Fix | Delete
if (!doc.contains(node)) {
[14403] Fix | Delete
return;
[14404] Fix | Delete
}
[14405] Fix | Delete
item(node, doc, schema);
[14406] Fix | Delete
});
[14407] Fix | Delete
});
[14408] Fix | Delete
}
[14409] Fix | Delete
[14410] Fix | Delete
/**
[14411] Fix | Delete
* Given node filters, deeply filters HTML tags.
[14412] Fix | Delete
* Filters from the deepest nodes to the top.
[14413] Fix | Delete
*
[14414] Fix | Delete
* @param {string} HTML The HTML to filter.
[14415] Fix | Delete
* @param {Array} filters An array of functions that can mutate with the provided node.
[14416] Fix | Delete
* @param {Object} schema The schema to use.
[14417] Fix | Delete
*
[14418] Fix | Delete
* @return {string} The filtered HTML.
[14419] Fix | Delete
*/
[14420] Fix | Delete
function deepFilterHTML(HTML, filters = [], schema) {
[14421] Fix | Delete
const doc = document.implementation.createHTMLDocument('');
[14422] Fix | Delete
doc.body.innerHTML = HTML;
[14423] Fix | Delete
deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
[14424] Fix | Delete
return doc.body.innerHTML;
[14425] Fix | Delete
}
[14426] Fix | Delete
[14427] Fix | Delete
/**
[14428] Fix | Delete
* Gets a sibling within text-level context.
[14429] Fix | Delete
*
[14430] Fix | Delete
* @param {Element} node The subject node.
[14431] Fix | Delete
* @param {string} which "next" or "previous".
[14432] Fix | Delete
*/
[14433] Fix | Delete
function getSibling(node, which) {
[14434] Fix | Delete
const sibling = node[`${which}Sibling`];
[14435] Fix | Delete
if (sibling && (0,external_wp_dom_namespaceObject.isPhrasingContent)(sibling)) {
[14436] Fix | Delete
return sibling;
[14437] Fix | Delete
}
[14438] Fix | Delete
const {
[14439] Fix | Delete
parentNode
[14440] Fix | Delete
} = node;
[14441] Fix | Delete
if (!parentNode || !(0,external_wp_dom_namespaceObject.isPhrasingContent)(parentNode)) {
[14442] Fix | Delete
return;
[14443] Fix | Delete
}
[14444] Fix | Delete
return getSibling(parentNode, which);
[14445] Fix | Delete
}
[14446] Fix | Delete
[14447] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js
[14448] Fix | Delete
/**
[14449] Fix | Delete
* WordPress dependencies
[14450] Fix | Delete
*/
[14451] Fix | Delete
[14452] Fix | Delete
[14453] Fix | Delete
[14454] Fix | Delete
/**
[14455] Fix | Delete
* Internal dependencies
[14456] Fix | Delete
*/
[14457] Fix | Delete
[14458] Fix | Delete
[14459] Fix | Delete
[14460] Fix | Delete
[14461] Fix | Delete
[14462] Fix | Delete
[14463] Fix | Delete
[14464] Fix | Delete
[14465] Fix | Delete
[14466] Fix | Delete
[14467] Fix | Delete
function deprecatedGetPhrasingContentSchema(context) {
[14468] Fix | Delete
external_wp_deprecated_default()('wp.blocks.getPhrasingContentSchema', {
[14469] Fix | Delete
since: '5.6',
[14470] Fix | Delete
alternative: 'wp.dom.getPhrasingContentSchema'
[14471] Fix | Delete
});
[14472] Fix | Delete
return (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context);
[14473] Fix | Delete
}
[14474] Fix | Delete
[14475] Fix | Delete
/**
[14476] Fix | Delete
* Converts an HTML string to known blocks.
[14477] Fix | Delete
*
[14478] Fix | Delete
* @param {Object} $1
[14479] Fix | Delete
* @param {string} $1.HTML The HTML to convert.
[14480] Fix | Delete
*
[14481] Fix | Delete
* @return {Array} A list of blocks.
[14482] Fix | Delete
*/
[14483] Fix | Delete
function rawHandler({
[14484] Fix | Delete
HTML = ''
[14485] Fix | Delete
}) {
[14486] Fix | Delete
// If we detect block delimiters, parse entirely as blocks.
[14487] Fix | Delete
if (HTML.indexOf('<!-- wp:') !== -1) {
[14488] Fix | Delete
const parseResult = parser_parse(HTML);
[14489] Fix | Delete
const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === 'core/freeform';
[14490] Fix | Delete
if (!isSingleFreeFormBlock) {
[14491] Fix | Delete
return parseResult;
[14492] Fix | Delete
}
[14493] Fix | Delete
}
[14494] Fix | Delete
[14495] Fix | Delete
// An array of HTML strings and block objects. The blocks replace matched
[14496] Fix | Delete
// shortcodes.
[14497] Fix | Delete
const pieces = shortcode_converter(HTML);
[14498] Fix | Delete
const blockContentSchema = getBlockContentSchema();
[14499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function