Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
args = _ref.args;
[5500] Fix | Delete
return log.apply(void 0, Object(toConsumableArray["a" /* default */])(args));
[5501] Fix | Delete
});
[5502] Fix | Delete
}
[5503] Fix | Delete
}
[5504] Fix | Delete
[5505] Fix | Delete
return block;
[5506] Fix | Delete
}
[5507] Fix | Delete
/**
[5508] Fix | Delete
* Serializes a block node into the native HTML-comment-powered block format.
[5509] Fix | Delete
* CAVEAT: This function is intended for reserializing blocks as parsed by
[5510] Fix | Delete
* valid parsers and skips any validation steps. This is NOT a generic
[5511] Fix | Delete
* serialization function for in-memory blocks. For most purposes, see the
[5512] Fix | Delete
* following functions available in the `@wordpress/blocks` package:
[5513] Fix | Delete
*
[5514] Fix | Delete
* @see serializeBlock
[5515] Fix | Delete
* @see serialize
[5516] Fix | Delete
*
[5517] Fix | Delete
* For more on the format of block nodes as returned by valid parsers:
[5518] Fix | Delete
*
[5519] Fix | Delete
* @see `@wordpress/block-serialization-default-parser` package
[5520] Fix | Delete
* @see `@wordpress/block-serialization-spec-parser` package
[5521] Fix | Delete
*
[5522] Fix | Delete
* @param {Object} blockNode A block node as returned by a valid parser.
[5523] Fix | Delete
* @param {?Object} options Serialization options.
[5524] Fix | Delete
* @param {?boolean} options.isCommentDelimited Whether to output HTML comments around blocks.
[5525] Fix | Delete
*
[5526] Fix | Delete
* @return {string} An HTML string representing a block.
[5527] Fix | Delete
*/
[5528] Fix | Delete
[5529] Fix | Delete
function serializeBlockNode(blockNode) {
[5530] Fix | Delete
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
[5531] Fix | Delete
var _options$isCommentDel = options.isCommentDelimited,
[5532] Fix | Delete
isCommentDelimited = _options$isCommentDel === void 0 ? true : _options$isCommentDel;
[5533] Fix | Delete
var blockName = blockNode.blockName,
[5534] Fix | Delete
_blockNode$attrs = blockNode.attrs,
[5535] Fix | Delete
attrs = _blockNode$attrs === void 0 ? {} : _blockNode$attrs,
[5536] Fix | Delete
_blockNode$innerBlock2 = blockNode.innerBlocks,
[5537] Fix | Delete
innerBlocks = _blockNode$innerBlock2 === void 0 ? [] : _blockNode$innerBlock2,
[5538] Fix | Delete
_blockNode$innerConte = blockNode.innerContent,
[5539] Fix | Delete
innerContent = _blockNode$innerConte === void 0 ? [] : _blockNode$innerConte;
[5540] Fix | Delete
var childIndex = 0;
[5541] Fix | Delete
var content = innerContent.map(function (item) {
[5542] Fix | Delete
return (// `null` denotes a nested block, otherwise we have an HTML fragment.
[5543] Fix | Delete
item !== null ? item : serializeBlockNode(innerBlocks[childIndex++], options)
[5544] Fix | Delete
);
[5545] Fix | Delete
}).join('\n').replace(/\n+/g, '\n').trim();
[5546] Fix | Delete
return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content;
[5547] Fix | Delete
}
[5548] Fix | Delete
/**
[5549] Fix | Delete
* Creates a parse implementation for the post content which returns a list of blocks.
[5550] Fix | Delete
*
[5551] Fix | Delete
* @param {Function} parseImplementation Parse implementation.
[5552] Fix | Delete
*
[5553] Fix | Delete
* @return {Function} An implementation which parses the post content.
[5554] Fix | Delete
*/
[5555] Fix | Delete
[5556] Fix | Delete
var createParse = function createParse(parseImplementation) {
[5557] Fix | Delete
return function (content) {
[5558] Fix | Delete
return parseImplementation(content).reduce(function (accumulator, blockNode) {
[5559] Fix | Delete
var block = createBlockWithFallback(blockNode);
[5560] Fix | Delete
[5561] Fix | Delete
if (block) {
[5562] Fix | Delete
accumulator.push(block);
[5563] Fix | Delete
}
[5564] Fix | Delete
[5565] Fix | Delete
return accumulator;
[5566] Fix | Delete
}, []);
[5567] Fix | Delete
};
[5568] Fix | Delete
};
[5569] Fix | Delete
/**
[5570] Fix | Delete
* Utilizes an optimized token-driven parser based on the Gutenberg grammar spec
[5571] Fix | Delete
* defined through a parsing expression grammar to take advantage of the regular
[5572] Fix | Delete
* cadence provided by block delimiters -- composed syntactically through HTML
[5573] Fix | Delete
* comments -- which, given a general HTML document as an input, returns a block
[5574] Fix | Delete
* list array representation.
[5575] Fix | Delete
*
[5576] Fix | Delete
* This is a recursive-descent parser that scans linearly once through the input
[5577] Fix | Delete
* document. Instead of directly recursing it utilizes a trampoline mechanism to
[5578] Fix | Delete
* prevent stack overflow. This initial pass is mainly interested in separating
[5579] Fix | Delete
* and isolating the blocks serialized in the document and manifestly not in the
[5580] Fix | Delete
* content within the blocks.
[5581] Fix | Delete
*
[5582] Fix | Delete
* @see
[5583] Fix | Delete
* https://developer.wordpress.org/block-editor/packages/packages-block-serialization-default-parser/
[5584] Fix | Delete
*
[5585] Fix | Delete
* @param {string} content The post content.
[5586] Fix | Delete
*
[5587] Fix | Delete
* @return {Array} Block list.
[5588] Fix | Delete
*/
[5589] Fix | Delete
[5590] Fix | Delete
[5591] Fix | Delete
var parseWithGrammar = createParse(external_wp_blockSerializationDefaultParser_["parse"]);
[5592] Fix | Delete
/* harmony default export */ var parser = (parseWithGrammar);
[5593] Fix | Delete
[5594] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/get-raw-transforms.js
[5595] Fix | Delete
[5596] Fix | Delete
[5597] Fix | Delete
function get_raw_transforms_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; }
[5598] Fix | Delete
[5599] Fix | Delete
function get_raw_transforms_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { get_raw_transforms_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 { get_raw_transforms_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[5600] Fix | Delete
[5601] Fix | Delete
/**
[5602] Fix | Delete
* External dependencies
[5603] Fix | Delete
*/
[5604] Fix | Delete
[5605] Fix | Delete
/**
[5606] Fix | Delete
* Internal dependencies
[5607] Fix | Delete
*/
[5608] Fix | Delete
[5609] Fix | Delete
[5610] Fix | Delete
function getRawTransforms() {
[5611] Fix | Delete
return Object(external_lodash_["filter"])(getBlockTransforms('from'), {
[5612] Fix | Delete
type: 'raw'
[5613] Fix | Delete
}).map(function (transform) {
[5614] Fix | Delete
return transform.isMatch ? transform : get_raw_transforms_objectSpread(get_raw_transforms_objectSpread({}, transform), {}, {
[5615] Fix | Delete
isMatch: function isMatch(node) {
[5616] Fix | Delete
return transform.selector && node.matches(transform.selector);
[5617] Fix | Delete
}
[5618] Fix | Delete
});
[5619] Fix | Delete
});
[5620] Fix | Delete
}
[5621] Fix | Delete
[5622] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-to-blocks.js
[5623] Fix | Delete
/**
[5624] Fix | Delete
* Internal dependencies
[5625] Fix | Delete
*/
[5626] Fix | Delete
[5627] Fix | Delete
[5628] Fix | Delete
[5629] Fix | Delete
/**
[5630] Fix | Delete
* Converts HTML directly to blocks. Looks for a matching transform for each
[5631] Fix | Delete
* top-level tag. The HTML should be filtered to not have any text between
[5632] Fix | Delete
* top-level tags and formatted in a way that blocks can handle the HTML.
[5633] Fix | Delete
*
[5634] Fix | Delete
* @param {string} html HTML to convert.
[5635] Fix | Delete
*
[5636] Fix | Delete
* @return {Array} An array of blocks.
[5637] Fix | Delete
*/
[5638] Fix | Delete
[5639] Fix | Delete
function htmlToBlocks(html) {
[5640] Fix | Delete
var doc = document.implementation.createHTMLDocument('');
[5641] Fix | Delete
doc.body.innerHTML = html;
[5642] Fix | Delete
return Array.from(doc.body.children).flatMap(function (node) {
[5643] Fix | Delete
var rawTransform = findTransform(getRawTransforms(), function (_ref) {
[5644] Fix | Delete
var isMatch = _ref.isMatch;
[5645] Fix | Delete
return isMatch(node);
[5646] Fix | Delete
});
[5647] Fix | Delete
[5648] Fix | Delete
if (!rawTransform) {
[5649] Fix | Delete
return createBlock( // Should not be hardcoded.
[5650] Fix | Delete
'core/html', getBlockAttributes('core/html', node.outerHTML));
[5651] Fix | Delete
}
[5652] Fix | Delete
[5653] Fix | Delete
var transform = rawTransform.transform,
[5654] Fix | Delete
blockName = rawTransform.blockName;
[5655] Fix | Delete
[5656] Fix | Delete
if (transform) {
[5657] Fix | Delete
return transform(node);
[5658] Fix | Delete
}
[5659] Fix | Delete
[5660] Fix | Delete
return createBlock(blockName, getBlockAttributes(blockName, node.outerHTML));
[5661] Fix | Delete
});
[5662] Fix | Delete
}
[5663] Fix | Delete
[5664] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js
[5665] Fix | Delete
/**
[5666] Fix | Delete
* WordPress dependencies
[5667] Fix | Delete
*/
[5668] Fix | Delete
[5669] Fix | Delete
function normaliseBlocks(HTML) {
[5670] Fix | Delete
var decuDoc = document.implementation.createHTMLDocument('');
[5671] Fix | Delete
var accuDoc = document.implementation.createHTMLDocument('');
[5672] Fix | Delete
var decu = decuDoc.body;
[5673] Fix | Delete
var accu = accuDoc.body;
[5674] Fix | Delete
decu.innerHTML = HTML;
[5675] Fix | Delete
[5676] Fix | Delete
while (decu.firstChild) {
[5677] Fix | Delete
var node = decu.firstChild; // Text nodes: wrap in a paragraph, or append to previous.
[5678] Fix | Delete
[5679] Fix | Delete
if (node.nodeType === node.TEXT_NODE) {
[5680] Fix | Delete
if (!node.nodeValue.trim()) {
[5681] Fix | Delete
decu.removeChild(node);
[5682] Fix | Delete
} else {
[5683] Fix | Delete
if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
[5684] Fix | Delete
accu.appendChild(accuDoc.createElement('P'));
[5685] Fix | Delete
}
[5686] Fix | Delete
[5687] Fix | Delete
accu.lastChild.appendChild(node);
[5688] Fix | Delete
} // Element nodes.
[5689] Fix | Delete
[5690] Fix | Delete
} else if (node.nodeType === node.ELEMENT_NODE) {
[5691] Fix | Delete
// BR nodes: create a new paragraph on double, or append to previous.
[5692] Fix | Delete
if (node.nodeName === 'BR') {
[5693] Fix | Delete
if (node.nextSibling && node.nextSibling.nodeName === 'BR') {
[5694] Fix | Delete
accu.appendChild(accuDoc.createElement('P'));
[5695] Fix | Delete
decu.removeChild(node.nextSibling);
[5696] Fix | Delete
} // Don't append to an empty paragraph.
[5697] Fix | Delete
[5698] Fix | Delete
[5699] Fix | Delete
if (accu.lastChild && accu.lastChild.nodeName === 'P' && accu.lastChild.hasChildNodes()) {
[5700] Fix | Delete
accu.lastChild.appendChild(node);
[5701] Fix | Delete
} else {
[5702] Fix | Delete
decu.removeChild(node);
[5703] Fix | Delete
}
[5704] Fix | Delete
} else if (node.nodeName === 'P') {
[5705] Fix | Delete
// Only append non-empty paragraph nodes.
[5706] Fix | Delete
if (Object(external_wp_dom_["isEmpty"])(node)) {
[5707] Fix | Delete
decu.removeChild(node);
[5708] Fix | Delete
} else {
[5709] Fix | Delete
accu.appendChild(node);
[5710] Fix | Delete
}
[5711] Fix | Delete
} else if (Object(external_wp_dom_["isPhrasingContent"])(node)) {
[5712] Fix | Delete
if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
[5713] Fix | Delete
accu.appendChild(accuDoc.createElement('P'));
[5714] Fix | Delete
}
[5715] Fix | Delete
[5716] Fix | Delete
accu.lastChild.appendChild(node);
[5717] Fix | Delete
} else {
[5718] Fix | Delete
accu.appendChild(node);
[5719] Fix | Delete
}
[5720] Fix | Delete
} else {
[5721] Fix | Delete
decu.removeChild(node);
[5722] Fix | Delete
}
[5723] Fix | Delete
}
[5724] Fix | Delete
[5725] Fix | Delete
return accu.innerHTML;
[5726] Fix | Delete
}
[5727] Fix | Delete
[5728] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js
[5729] Fix | Delete
/**
[5730] Fix | Delete
* WordPress dependencies
[5731] Fix | Delete
*/
[5732] Fix | Delete
[5733] Fix | Delete
/**
[5734] Fix | Delete
* Looks for `<!--nextpage-->` and `<!--more-->` comments, as well as the
[5735] Fix | Delete
* `<!--more Some text-->` variant and its `<!--noteaser-->` companion,
[5736] Fix | Delete
* and replaces them with a custom element representing a future block.
[5737] Fix | Delete
*
[5738] Fix | Delete
* The custom element is a way to bypass the rest of the `raw-handling`
[5739] Fix | Delete
* transforms, which would eliminate other kinds of node with which to carry
[5740] Fix | Delete
* `<!--more-->`'s data: nodes with `data` attributes, empty paragraphs, etc.
[5741] Fix | Delete
*
[5742] Fix | Delete
* The custom element is then expected to be recognized by any registered
[5743] Fix | Delete
* block's `raw` transform.
[5744] Fix | Delete
*
[5745] Fix | Delete
* @param {Node} node The node to be processed.
[5746] Fix | Delete
* @param {Document} doc The document of the node.
[5747] Fix | Delete
* @return {void}
[5748] Fix | Delete
*/
[5749] Fix | Delete
[5750] Fix | Delete
function specialCommentConverter(node, doc) {
[5751] Fix | Delete
if (node.nodeType !== node.COMMENT_NODE) {
[5752] Fix | Delete
return;
[5753] Fix | Delete
}
[5754] Fix | Delete
[5755] Fix | Delete
if (node.nodeValue === 'nextpage') {
[5756] Fix | Delete
Object(external_wp_dom_["replace"])(node, createNextpage(doc));
[5757] Fix | Delete
return;
[5758] Fix | Delete
}
[5759] Fix | Delete
[5760] Fix | Delete
if (node.nodeValue.indexOf('more') === 0) {
[5761] Fix | Delete
// Grab any custom text in the comment.
[5762] Fix | Delete
var customText = node.nodeValue.slice(4).trim();
[5763] Fix | Delete
/*
[5764] Fix | Delete
* When a `<!--more-->` comment is found, we need to look for any
[5765] Fix | Delete
* `<!--noteaser-->` sibling, but it may not be a direct sibling
[5766] Fix | Delete
* (whitespace typically lies in between)
[5767] Fix | Delete
*/
[5768] Fix | Delete
[5769] Fix | Delete
var sibling = node;
[5770] Fix | Delete
var noTeaser = false;
[5771] Fix | Delete
[5772] Fix | Delete
while (sibling = sibling.nextSibling) {
[5773] Fix | Delete
if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === 'noteaser') {
[5774] Fix | Delete
noTeaser = true;
[5775] Fix | Delete
Object(external_wp_dom_["remove"])(sibling);
[5776] Fix | Delete
break;
[5777] Fix | Delete
}
[5778] Fix | Delete
}
[5779] Fix | Delete
[5780] Fix | Delete
Object(external_wp_dom_["replace"])(node, createMore(customText, noTeaser, doc));
[5781] Fix | Delete
}
[5782] Fix | Delete
}
[5783] Fix | Delete
[5784] Fix | Delete
function createMore(customText, noTeaser, doc) {
[5785] Fix | Delete
var node = doc.createElement('wp-block');
[5786] Fix | Delete
node.dataset.block = 'core/more';
[5787] Fix | Delete
[5788] Fix | Delete
if (customText) {
[5789] Fix | Delete
node.dataset.customText = customText;
[5790] Fix | Delete
}
[5791] Fix | Delete
[5792] Fix | Delete
if (noTeaser) {
[5793] Fix | Delete
// "Boolean" data attribute
[5794] Fix | Delete
node.dataset.noTeaser = '';
[5795] Fix | Delete
}
[5796] Fix | Delete
[5797] Fix | Delete
return node;
[5798] Fix | Delete
}
[5799] Fix | Delete
[5800] Fix | Delete
function createNextpage(doc) {
[5801] Fix | Delete
var node = doc.createElement('wp-block');
[5802] Fix | Delete
node.dataset.block = 'core/nextpage';
[5803] Fix | Delete
return node;
[5804] Fix | Delete
}
[5805] Fix | Delete
[5806] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
[5807] Fix | Delete
/**
[5808] Fix | Delete
* WordPress dependencies
[5809] Fix | Delete
*/
[5810] Fix | Delete
[5811] Fix | Delete
/**
[5812] Fix | Delete
* Looks for comments, and removes them.
[5813] Fix | Delete
*
[5814] Fix | Delete
* @param {Node} node The node to be processed.
[5815] Fix | Delete
* @return {void}
[5816] Fix | Delete
*/
[5817] Fix | Delete
[5818] Fix | Delete
function commentRemover(node) {
[5819] Fix | Delete
if (node.nodeType === node.COMMENT_NODE) {
[5820] Fix | Delete
Object(external_wp_dom_["remove"])(node);
[5821] Fix | Delete
}
[5822] Fix | Delete
}
[5823] Fix | Delete
[5824] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
[5825] Fix | Delete
/**
[5826] Fix | Delete
* External dependencies
[5827] Fix | Delete
*/
[5828] Fix | Delete
[5829] Fix | Delete
/**
[5830] Fix | Delete
* WordPress dependencies
[5831] Fix | Delete
*/
[5832] Fix | Delete
[5833] Fix | Delete
[5834] Fix | Delete
/**
[5835] Fix | Delete
* Checks if the given node should be considered inline content, optionally
[5836] Fix | Delete
* depending on a context tag.
[5837] Fix | Delete
*
[5838] Fix | Delete
* @param {Node} node Node name.
[5839] Fix | Delete
* @param {string} contextTag Tag name.
[5840] Fix | Delete
*
[5841] Fix | Delete
* @return {boolean} True if the node is inline content, false if nohe.
[5842] Fix | Delete
*/
[5843] Fix | Delete
[5844] Fix | Delete
function isInline(node, contextTag) {
[5845] Fix | Delete
if (Object(external_wp_dom_["isTextContent"])(node)) {
[5846] Fix | Delete
return true;
[5847] Fix | Delete
}
[5848] Fix | Delete
[5849] Fix | Delete
if (!contextTag) {
[5850] Fix | Delete
return false;
[5851] Fix | Delete
}
[5852] Fix | Delete
[5853] Fix | Delete
var tag = node.nodeName.toLowerCase();
[5854] Fix | Delete
var inlineAllowedTagGroups = [['ul', 'li', 'ol'], ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']];
[5855] Fix | Delete
return inlineAllowedTagGroups.some(function (tagGroup) {
[5856] Fix | Delete
return Object(external_lodash_["difference"])([tag, contextTag], tagGroup).length === 0;
[5857] Fix | Delete
});
[5858] Fix | Delete
}
[5859] Fix | Delete
[5860] Fix | Delete
function deepCheck(nodes, contextTag) {
[5861] Fix | Delete
return nodes.every(function (node) {
[5862] Fix | Delete
return isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag);
[5863] Fix | Delete
});
[5864] Fix | Delete
}
[5865] Fix | Delete
[5866] Fix | Delete
function isDoubleBR(node) {
[5867] Fix | Delete
return node.nodeName === 'BR' && node.previousSibling && node.previousSibling.nodeName === 'BR';
[5868] Fix | Delete
}
[5869] Fix | Delete
[5870] Fix | Delete
function isInlineContent(HTML, contextTag) {
[5871] Fix | Delete
var doc = document.implementation.createHTMLDocument('');
[5872] Fix | Delete
doc.body.innerHTML = HTML;
[5873] Fix | Delete
var nodes = Array.from(doc.body.children);
[5874] Fix | Delete
return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
[5875] Fix | Delete
}
[5876] Fix | Delete
[5877] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js
[5878] Fix | Delete
/**
[5879] Fix | Delete
* External dependencies
[5880] Fix | Delete
*/
[5881] Fix | Delete
[5882] Fix | Delete
/**
[5883] Fix | Delete
* WordPress dependencies
[5884] Fix | Delete
*/
[5885] Fix | Delete
[5886] Fix | Delete
[5887] Fix | Delete
function phrasingContentReducer(node, doc) {
[5888] Fix | Delete
// In jsdom-jscore, 'node.style' can be null.
[5889] Fix | Delete
// TODO: Explore fixing this by patching jsdom-jscore.
[5890] Fix | Delete
if (node.nodeName === 'SPAN' && node.style) {
[5891] Fix | Delete
var _node$style = node.style,
[5892] Fix | Delete
fontWeight = _node$style.fontWeight,
[5893] Fix | Delete
fontStyle = _node$style.fontStyle,
[5894] Fix | Delete
textDecorationLine = _node$style.textDecorationLine,
[5895] Fix | Delete
textDecoration = _node$style.textDecoration,
[5896] Fix | Delete
verticalAlign = _node$style.verticalAlign;
[5897] Fix | Delete
[5898] Fix | Delete
if (fontWeight === 'bold' || fontWeight === '700') {
[5899] Fix | Delete
Object(external_wp_dom_["wrap"])(doc.createElement('strong'), node);
[5900] Fix | Delete
}
[5901] Fix | Delete
[5902] Fix | Delete
if (fontStyle === 'italic') {
[5903] Fix | Delete
Object(external_wp_dom_["wrap"])(doc.createElement('em'), node);
[5904] Fix | Delete
} // Some DOM implementations (Safari, JSDom) don't support
[5905] Fix | Delete
// style.textDecorationLine, so we check style.textDecoration as a
[5906] Fix | Delete
// fallback.
[5907] Fix | Delete
[5908] Fix | Delete
[5909] Fix | Delete
if (textDecorationLine === 'line-through' || Object(external_lodash_["includes"])(textDecoration, 'line-through')) {
[5910] Fix | Delete
Object(external_wp_dom_["wrap"])(doc.createElement('s'), node);
[5911] Fix | Delete
}
[5912] Fix | Delete
[5913] Fix | Delete
if (verticalAlign === 'super') {
[5914] Fix | Delete
Object(external_wp_dom_["wrap"])(doc.createElement('sup'), node);
[5915] Fix | Delete
} else if (verticalAlign === 'sub') {
[5916] Fix | Delete
Object(external_wp_dom_["wrap"])(doc.createElement('sub'), node);
[5917] Fix | Delete
}
[5918] Fix | Delete
} else if (node.nodeName === 'B') {
[5919] Fix | Delete
node = Object(external_wp_dom_["replaceTag"])(node, 'strong');
[5920] Fix | Delete
} else if (node.nodeName === 'I') {
[5921] Fix | Delete
node = Object(external_wp_dom_["replaceTag"])(node, 'em');
[5922] Fix | Delete
} else if (node.nodeName === 'A') {
[5923] Fix | Delete
// In jsdom-jscore, 'node.target' can be null.
[5924] Fix | Delete
// TODO: Explore fixing this by patching jsdom-jscore.
[5925] Fix | Delete
if (node.target && node.target.toLowerCase() === '_blank') {
[5926] Fix | Delete
node.rel = 'noreferrer noopener';
[5927] Fix | Delete
} else {
[5928] Fix | Delete
node.removeAttribute('target');
[5929] Fix | Delete
node.removeAttribute('rel');
[5930] Fix | Delete
}
[5931] Fix | Delete
}
[5932] Fix | Delete
}
[5933] Fix | Delete
[5934] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js
[5935] Fix | Delete
function headRemover(node) {
[5936] Fix | Delete
if (node.nodeName !== 'SCRIPT' && node.nodeName !== 'NOSCRIPT' && node.nodeName !== 'TEMPLATE' && node.nodeName !== 'STYLE') {
[5937] Fix | Delete
return;
[5938] Fix | Delete
}
[5939] Fix | Delete
[5940] Fix | Delete
node.parentNode.removeChild(node);
[5941] Fix | Delete
}
[5942] Fix | Delete
[5943] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js
[5944] Fix | Delete
/**
[5945] Fix | Delete
* Browser dependencies
[5946] Fix | Delete
*/
[5947] Fix | Delete
var _window = window,
[5948] Fix | Delete
ms_list_converter_parseInt = _window.parseInt;
[5949] Fix | Delete
[5950] Fix | Delete
function isList(node) {
[5951] Fix | Delete
return node.nodeName === 'OL' || node.nodeName === 'UL';
[5952] Fix | Delete
}
[5953] Fix | Delete
[5954] Fix | Delete
function msListConverter(node, doc) {
[5955] Fix | Delete
if (node.nodeName !== 'P') {
[5956] Fix | Delete
return;
[5957] Fix | Delete
}
[5958] Fix | Delete
[5959] Fix | Delete
var style = node.getAttribute('style');
[5960] Fix | Delete
[5961] Fix | Delete
if (!style) {
[5962] Fix | Delete
return;
[5963] Fix | Delete
} // Quick check.
[5964] Fix | Delete
[5965] Fix | Delete
[5966] Fix | Delete
if (style.indexOf('mso-list') === -1) {
[5967] Fix | Delete
return;
[5968] Fix | Delete
}
[5969] Fix | Delete
[5970] Fix | Delete
var matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
[5971] Fix | Delete
[5972] Fix | Delete
if (!matches) {
[5973] Fix | Delete
return;
[5974] Fix | Delete
}
[5975] Fix | Delete
[5976] Fix | Delete
var level = ms_list_converter_parseInt(matches[1], 10) - 1 || 0;
[5977] Fix | Delete
var prevNode = node.previousElementSibling; // Add new list if no previous.
[5978] Fix | Delete
[5979] Fix | Delete
if (!prevNode || !isList(prevNode)) {
[5980] Fix | Delete
// See https://html.spec.whatwg.org/multipage/grouping-content.html#attr-ol-type.
[5981] Fix | Delete
var type = node.textContent.trim().slice(0, 1);
[5982] Fix | Delete
var isNumeric = /[1iIaA]/.test(type);
[5983] Fix | Delete
var newListNode = doc.createElement(isNumeric ? 'ol' : 'ul');
[5984] Fix | Delete
[5985] Fix | Delete
if (isNumeric) {
[5986] Fix | Delete
newListNode.setAttribute('type', type);
[5987] Fix | Delete
}
[5988] Fix | Delete
[5989] Fix | Delete
node.parentNode.insertBefore(newListNode, node);
[5990] Fix | Delete
}
[5991] Fix | Delete
[5992] Fix | Delete
var listNode = node.previousElementSibling;
[5993] Fix | Delete
var listType = listNode.nodeName;
[5994] Fix | Delete
var listItem = doc.createElement('li');
[5995] Fix | Delete
var receivingNode = listNode; // Remove the first span with list info.
[5996] Fix | Delete
[5997] Fix | Delete
node.removeChild(node.firstElementChild); // Add content.
[5998] Fix | Delete
[5999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function