Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: blocks.js
while (node.firstChild) {
[6000] Fix | Delete
listItem.appendChild(node.firstChild);
[6001] Fix | Delete
} // Change pointer depending on indentation level.
[6002] Fix | Delete
[6003] Fix | Delete
[6004] Fix | Delete
while (level--) {
[6005] Fix | Delete
receivingNode = receivingNode.lastElementChild || receivingNode; // If it's a list, move pointer to the last item.
[6006] Fix | Delete
[6007] Fix | Delete
if (isList(receivingNode)) {
[6008] Fix | Delete
receivingNode = receivingNode.lastElementChild || receivingNode;
[6009] Fix | Delete
}
[6010] Fix | Delete
} // Make sure we append to a list.
[6011] Fix | Delete
[6012] Fix | Delete
[6013] Fix | Delete
if (!isList(receivingNode)) {
[6014] Fix | Delete
receivingNode = receivingNode.appendChild(doc.createElement(listType));
[6015] Fix | Delete
} // Append the list item to the list.
[6016] Fix | Delete
[6017] Fix | Delete
[6018] Fix | Delete
receivingNode.appendChild(listItem); // Remove the wrapper paragraph.
[6019] Fix | Delete
[6020] Fix | Delete
node.parentNode.removeChild(node);
[6021] Fix | Delete
}
[6022] Fix | Delete
[6023] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js
[6024] Fix | Delete
/**
[6025] Fix | Delete
* WordPress dependencies
[6026] Fix | Delete
*/
[6027] Fix | Delete
[6028] Fix | Delete
[6029] Fix | Delete
function list_reducer_isList(node) {
[6030] Fix | Delete
return node.nodeName === 'OL' || node.nodeName === 'UL';
[6031] Fix | Delete
}
[6032] Fix | Delete
[6033] Fix | Delete
function shallowTextContent(element) {
[6034] Fix | Delete
return Array.from(element.childNodes).map(function (_ref) {
[6035] Fix | Delete
var _ref$nodeValue = _ref.nodeValue,
[6036] Fix | Delete
nodeValue = _ref$nodeValue === void 0 ? '' : _ref$nodeValue;
[6037] Fix | Delete
return nodeValue;
[6038] Fix | Delete
}).join('');
[6039] Fix | Delete
}
[6040] Fix | Delete
[6041] Fix | Delete
function listReducer(node) {
[6042] Fix | Delete
if (!list_reducer_isList(node)) {
[6043] Fix | Delete
return;
[6044] Fix | Delete
}
[6045] Fix | Delete
[6046] Fix | Delete
var list = node;
[6047] Fix | Delete
var prevElement = node.previousElementSibling; // Merge with previous list if:
[6048] Fix | Delete
// * There is a previous list of the same type.
[6049] Fix | Delete
// * There is only one list item.
[6050] Fix | Delete
[6051] Fix | Delete
if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
[6052] Fix | Delete
// Move all child nodes, including any text nodes, if any.
[6053] Fix | Delete
while (list.firstChild) {
[6054] Fix | Delete
prevElement.appendChild(list.firstChild);
[6055] Fix | Delete
}
[6056] Fix | Delete
[6057] Fix | Delete
list.parentNode.removeChild(list);
[6058] Fix | Delete
}
[6059] Fix | Delete
[6060] Fix | Delete
var parentElement = node.parentNode; // Nested list with empty parent item.
[6061] Fix | Delete
[6062] Fix | Delete
if (parentElement && parentElement.nodeName === 'LI' && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
[6063] Fix | Delete
var parentListItem = parentElement;
[6064] Fix | Delete
var prevListItem = parentListItem.previousElementSibling;
[6065] Fix | Delete
var parentList = parentListItem.parentNode;
[6066] Fix | Delete
[6067] Fix | Delete
if (prevListItem) {
[6068] Fix | Delete
prevListItem.appendChild(list);
[6069] Fix | Delete
parentList.removeChild(parentListItem);
[6070] Fix | Delete
} else {
[6071] Fix | Delete
parentList.parentNode.insertBefore(list, parentList);
[6072] Fix | Delete
parentList.parentNode.removeChild(parentList);
[6073] Fix | Delete
}
[6074] Fix | Delete
} // Invalid: OL/UL > OL/UL.
[6075] Fix | Delete
[6076] Fix | Delete
[6077] Fix | Delete
if (parentElement && list_reducer_isList(parentElement)) {
[6078] Fix | Delete
var _prevListItem = node.previousElementSibling;
[6079] Fix | Delete
[6080] Fix | Delete
if (_prevListItem) {
[6081] Fix | Delete
_prevListItem.appendChild(node);
[6082] Fix | Delete
} else {
[6083] Fix | Delete
Object(external_wp_dom_["unwrap"])(node);
[6084] Fix | Delete
}
[6085] Fix | Delete
}
[6086] Fix | Delete
}
[6087] Fix | Delete
[6088] Fix | Delete
// EXTERNAL MODULE: external ["wp","blob"]
[6089] Fix | Delete
var external_wp_blob_ = __webpack_require__("xTGt");
[6090] Fix | Delete
[6091] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js
[6092] Fix | Delete
[6093] Fix | Delete
[6094] Fix | Delete
/**
[6095] Fix | Delete
* WordPress dependencies
[6096] Fix | Delete
*/
[6097] Fix | Delete
[6098] Fix | Delete
/**
[6099] Fix | Delete
* Browser dependencies
[6100] Fix | Delete
*/
[6101] Fix | Delete
[6102] Fix | Delete
var image_corrector_window = window,
[6103] Fix | Delete
atob = image_corrector_window.atob,
[6104] Fix | Delete
File = image_corrector_window.File;
[6105] Fix | Delete
function imageCorrector(node) {
[6106] Fix | Delete
if (node.nodeName !== 'IMG') {
[6107] Fix | Delete
return;
[6108] Fix | Delete
}
[6109] Fix | Delete
[6110] Fix | Delete
if (node.src.indexOf('file:') === 0) {
[6111] Fix | Delete
node.src = '';
[6112] Fix | Delete
} // This piece cannot be tested outside a browser env.
[6113] Fix | Delete
[6114] Fix | Delete
[6115] Fix | Delete
if (node.src.indexOf('data:') === 0) {
[6116] Fix | Delete
var _node$src$split = node.src.split(','),
[6117] Fix | Delete
_node$src$split2 = Object(slicedToArray["a" /* default */])(_node$src$split, 2),
[6118] Fix | Delete
properties = _node$src$split2[0],
[6119] Fix | Delete
data = _node$src$split2[1];
[6120] Fix | Delete
[6121] Fix | Delete
var _properties$slice$spl = properties.slice(5).split(';'),
[6122] Fix | Delete
_properties$slice$spl2 = Object(slicedToArray["a" /* default */])(_properties$slice$spl, 1),
[6123] Fix | Delete
type = _properties$slice$spl2[0];
[6124] Fix | Delete
[6125] Fix | Delete
if (!data || !type) {
[6126] Fix | Delete
node.src = '';
[6127] Fix | Delete
return;
[6128] Fix | Delete
}
[6129] Fix | Delete
[6130] Fix | Delete
var decoded; // Can throw DOMException!
[6131] Fix | Delete
[6132] Fix | Delete
try {
[6133] Fix | Delete
decoded = atob(data);
[6134] Fix | Delete
} catch (e) {
[6135] Fix | Delete
node.src = '';
[6136] Fix | Delete
return;
[6137] Fix | Delete
}
[6138] Fix | Delete
[6139] Fix | Delete
var uint8Array = new Uint8Array(decoded.length);
[6140] Fix | Delete
[6141] Fix | Delete
for (var i = 0; i < uint8Array.length; i++) {
[6142] Fix | Delete
uint8Array[i] = decoded.charCodeAt(i);
[6143] Fix | Delete
}
[6144] Fix | Delete
[6145] Fix | Delete
var name = type.replace('/', '.');
[6146] Fix | Delete
var file = new File([uint8Array], name, {
[6147] Fix | Delete
type: type
[6148] Fix | Delete
});
[6149] Fix | Delete
node.src = Object(external_wp_blob_["createBlobURL"])(file);
[6150] Fix | Delete
} // Remove trackers and hardly visible images.
[6151] Fix | Delete
[6152] Fix | Delete
[6153] Fix | Delete
if (node.height === 1 || node.width === 1) {
[6154] Fix | Delete
node.parentNode.removeChild(node);
[6155] Fix | Delete
}
[6156] Fix | Delete
}
[6157] Fix | Delete
[6158] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js
[6159] Fix | Delete
/**
[6160] Fix | Delete
* Internal dependencies
[6161] Fix | Delete
*/
[6162] Fix | Delete
[6163] Fix | Delete
function blockquoteNormaliser(node) {
[6164] Fix | Delete
if (node.nodeName !== 'BLOCKQUOTE') {
[6165] Fix | Delete
return;
[6166] Fix | Delete
}
[6167] Fix | Delete
[6168] Fix | Delete
node.innerHTML = normaliseBlocks(node.innerHTML);
[6169] Fix | Delete
}
[6170] Fix | Delete
[6171] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js
[6172] Fix | Delete
/**
[6173] Fix | Delete
* External dependencies
[6174] Fix | Delete
*/
[6175] Fix | Delete
[6176] Fix | Delete
/**
[6177] Fix | Delete
* WordPress dependencies
[6178] Fix | Delete
*/
[6179] Fix | Delete
[6180] Fix | Delete
[6181] Fix | Delete
/**
[6182] Fix | Delete
* Whether or not the given node is figure content.
[6183] Fix | Delete
*
[6184] Fix | Delete
* @param {Node} node The node to check.
[6185] Fix | Delete
* @param {Object} schema The schema to use.
[6186] Fix | Delete
*
[6187] Fix | Delete
* @return {boolean} True if figure content, false if not.
[6188] Fix | Delete
*/
[6189] Fix | Delete
[6190] Fix | Delete
function isFigureContent(node, schema) {
[6191] Fix | Delete
var tag = node.nodeName.toLowerCase(); // We are looking for tags that can be a child of the figure tag, excluding
[6192] Fix | Delete
// `figcaption` and any phrasing content.
[6193] Fix | Delete
[6194] Fix | Delete
if (tag === 'figcaption' || Object(external_wp_dom_["isTextContent"])(node)) {
[6195] Fix | Delete
return false;
[6196] Fix | Delete
}
[6197] Fix | Delete
[6198] Fix | Delete
return Object(external_lodash_["has"])(schema, ['figure', 'children', tag]);
[6199] Fix | Delete
}
[6200] Fix | Delete
/**
[6201] Fix | Delete
* Whether or not the given node can have an anchor.
[6202] Fix | Delete
*
[6203] Fix | Delete
* @param {Node} node The node to check.
[6204] Fix | Delete
* @param {Object} schema The schema to use.
[6205] Fix | Delete
*
[6206] Fix | Delete
* @return {boolean} True if it can, false if not.
[6207] Fix | Delete
*/
[6208] Fix | Delete
[6209] Fix | Delete
[6210] Fix | Delete
function canHaveAnchor(node, schema) {
[6211] Fix | Delete
var tag = node.nodeName.toLowerCase();
[6212] Fix | Delete
return Object(external_lodash_["has"])(schema, ['figure', 'children', 'a', 'children', tag]);
[6213] Fix | Delete
}
[6214] Fix | Delete
/**
[6215] Fix | Delete
* Wraps the given element in a figure element.
[6216] Fix | Delete
*
[6217] Fix | Delete
* @param {Element} element The element to wrap.
[6218] Fix | Delete
* @param {Element} beforeElement The element before which to place the figure.
[6219] Fix | Delete
*/
[6220] Fix | Delete
[6221] Fix | Delete
[6222] Fix | Delete
function wrapFigureContent(element) {
[6223] Fix | Delete
var beforeElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element;
[6224] Fix | Delete
var figure = element.ownerDocument.createElement('figure');
[6225] Fix | Delete
beforeElement.parentNode.insertBefore(figure, beforeElement);
[6226] Fix | Delete
figure.appendChild(element);
[6227] Fix | Delete
}
[6228] Fix | Delete
/**
[6229] Fix | Delete
* This filter takes figure content out of paragraphs, wraps it in a figure
[6230] Fix | Delete
* element, and moves any anchors with it if needed.
[6231] Fix | Delete
*
[6232] Fix | Delete
* @param {Node} node The node to filter.
[6233] Fix | Delete
* @param {Document} doc The document of the node.
[6234] Fix | Delete
* @param {Object} schema The schema to use.
[6235] Fix | Delete
*
[6236] Fix | Delete
* @return {void}
[6237] Fix | Delete
*/
[6238] Fix | Delete
[6239] Fix | Delete
[6240] Fix | Delete
function figureContentReducer(node, doc, schema) {
[6241] Fix | Delete
if (!isFigureContent(node, schema)) {
[6242] Fix | Delete
return;
[6243] Fix | Delete
}
[6244] Fix | Delete
[6245] Fix | Delete
var nodeToInsert = node;
[6246] Fix | Delete
var parentNode = node.parentNode; // If the figure content can have an anchor and its parent is an anchor with
[6247] Fix | Delete
// only the figure content, take the anchor out instead of just the content.
[6248] Fix | Delete
[6249] Fix | Delete
if (canHaveAnchor(node, schema) && parentNode.nodeName === 'A' && parentNode.childNodes.length === 1) {
[6250] Fix | Delete
nodeToInsert = node.parentNode;
[6251] Fix | Delete
}
[6252] Fix | Delete
[6253] Fix | Delete
var wrapper = nodeToInsert.closest('p,div'); // If wrapped in a paragraph or div, only extract if it's aligned or if
[6254] Fix | Delete
// there is no text content.
[6255] Fix | Delete
// Otherwise, if directly at the root, wrap in a figure element.
[6256] Fix | Delete
[6257] Fix | Delete
if (wrapper) {
[6258] Fix | Delete
// In jsdom-jscore, 'node.classList' can be undefined.
[6259] Fix | Delete
// In this case, default to extract as it offers a better UI experience on mobile.
[6260] Fix | Delete
if (!node.classList) {
[6261] Fix | Delete
wrapFigureContent(nodeToInsert, wrapper);
[6262] Fix | Delete
} else if (node.classList.contains('alignright') || node.classList.contains('alignleft') || node.classList.contains('aligncenter') || !wrapper.textContent.trim()) {
[6263] Fix | Delete
wrapFigureContent(nodeToInsert, wrapper);
[6264] Fix | Delete
}
[6265] Fix | Delete
} else if (nodeToInsert.parentNode.nodeName === 'BODY') {
[6266] Fix | Delete
wrapFigureContent(nodeToInsert);
[6267] Fix | Delete
}
[6268] Fix | Delete
}
[6269] Fix | Delete
[6270] Fix | Delete
// EXTERNAL MODULE: external ["wp","shortcode"]
[6271] Fix | Delete
var external_wp_shortcode_ = __webpack_require__("SVSp");
[6272] Fix | Delete
[6273] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js
[6274] Fix | Delete
[6275] Fix | Delete
[6276] Fix | Delete
[6277] Fix | Delete
function shortcode_converter_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; }
[6278] Fix | Delete
[6279] Fix | Delete
function shortcode_converter_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { shortcode_converter_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 { shortcode_converter_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[6280] Fix | Delete
[6281] Fix | Delete
/**
[6282] Fix | Delete
* External dependencies
[6283] Fix | Delete
*/
[6284] Fix | Delete
[6285] Fix | Delete
/**
[6286] Fix | Delete
* WordPress dependencies
[6287] Fix | Delete
*/
[6288] Fix | Delete
[6289] Fix | Delete
[6290] Fix | Delete
/**
[6291] Fix | Delete
* Internal dependencies
[6292] Fix | Delete
*/
[6293] Fix | Delete
[6294] Fix | Delete
[6295] Fix | Delete
[6296] Fix | Delete
[6297] Fix | Delete
[6298] Fix | Delete
function segmentHTMLToShortcodeBlock(HTML) {
[6299] Fix | Delete
var lastIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
[6300] Fix | Delete
var excludedBlockNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
[6301] Fix | Delete
// Get all matches.
[6302] Fix | Delete
var transformsFrom = getBlockTransforms('from');
[6303] Fix | Delete
var transformation = findTransform(transformsFrom, function (transform) {
[6304] Fix | Delete
return excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && Object(external_lodash_["some"])(Object(external_lodash_["castArray"])(transform.tag), function (tag) {
[6305] Fix | Delete
return Object(external_wp_shortcode_["regexp"])(tag).test(HTML);
[6306] Fix | Delete
});
[6307] Fix | Delete
});
[6308] Fix | Delete
[6309] Fix | Delete
if (!transformation) {
[6310] Fix | Delete
return [HTML];
[6311] Fix | Delete
}
[6312] Fix | Delete
[6313] Fix | Delete
var transformTags = Object(external_lodash_["castArray"])(transformation.tag);
[6314] Fix | Delete
var transformTag = Object(external_lodash_["find"])(transformTags, function (tag) {
[6315] Fix | Delete
return Object(external_wp_shortcode_["regexp"])(tag).test(HTML);
[6316] Fix | Delete
});
[6317] Fix | Delete
var match;
[6318] Fix | Delete
var previousIndex = lastIndex;
[6319] Fix | Delete
[6320] Fix | Delete
if (match = Object(external_wp_shortcode_["next"])(transformTag, HTML, lastIndex)) {
[6321] Fix | Delete
lastIndex = match.index + match.content.length;
[6322] Fix | Delete
var beforeHTML = HTML.substr(0, match.index);
[6323] Fix | Delete
var afterHTML = HTML.substr(lastIndex); // If the shortcode content does not contain HTML and the shortcode is
[6324] Fix | Delete
// not on a new line (or in paragraph from Markdown converter),
[6325] Fix | Delete
// consider the shortcode as inline text, and thus skip conversion for
[6326] Fix | Delete
// this segment.
[6327] Fix | Delete
[6328] Fix | Delete
if (!Object(external_lodash_["includes"])(match.shortcode.content || '', '<') && !(/(\n|<p>)\s*$/.test(beforeHTML) && /^\s*(\n|<\/p>)/.test(afterHTML))) {
[6329] Fix | Delete
return segmentHTMLToShortcodeBlock(HTML, lastIndex);
[6330] Fix | Delete
} // If a transformation's `isMatch` predicate fails for the inbound
[6331] Fix | Delete
// shortcode, try again by excluding the current block type.
[6332] Fix | Delete
//
[6333] Fix | Delete
// This is the only call to `segmentHTMLToShortcodeBlock` that should
[6334] Fix | Delete
// ever carry over `excludedBlockNames`. Other calls in the module
[6335] Fix | Delete
// should skip that argument as a way to reset the exclusion state, so
[6336] Fix | Delete
// that one `isMatch` fail in an HTML fragment doesn't prevent any
[6337] Fix | Delete
// valid matches in subsequent fragments.
[6338] Fix | Delete
[6339] Fix | Delete
[6340] Fix | Delete
if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
[6341] Fix | Delete
return segmentHTMLToShortcodeBlock(HTML, previousIndex, [].concat(Object(toConsumableArray["a" /* default */])(excludedBlockNames), [transformation.blockName]));
[6342] Fix | Delete
}
[6343] Fix | Delete
[6344] Fix | Delete
var attributes = Object(external_lodash_["mapValues"])(Object(external_lodash_["pickBy"])(transformation.attributes, function (schema) {
[6345] Fix | Delete
return schema.shortcode;
[6346] Fix | Delete
}), // Passing all of `match` as second argument is intentionally broad
[6347] Fix | Delete
// but shouldn't be too relied upon.
[6348] Fix | Delete
//
[6349] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
[6350] Fix | Delete
function (schema) {
[6351] Fix | Delete
return schema.shortcode(match.shortcode.attrs, match);
[6352] Fix | Delete
});
[6353] Fix | Delete
var block = createBlock(transformation.blockName, getBlockAttributes(shortcode_converter_objectSpread(shortcode_converter_objectSpread({}, registration_getBlockType(transformation.blockName)), {}, {
[6354] Fix | Delete
attributes: transformation.attributes
[6355] Fix | Delete
}), match.shortcode.content, attributes));
[6356] Fix | Delete
return [].concat(Object(toConsumableArray["a" /* default */])(segmentHTMLToShortcodeBlock(beforeHTML)), [block], Object(toConsumableArray["a" /* default */])(segmentHTMLToShortcodeBlock(afterHTML)));
[6357] Fix | Delete
}
[6358] Fix | Delete
[6359] Fix | Delete
return [HTML];
[6360] Fix | Delete
}
[6361] Fix | Delete
[6362] Fix | Delete
/* harmony default export */ var shortcode_converter = (segmentHTMLToShortcodeBlock);
[6363] Fix | Delete
[6364] Fix | Delete
// EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js
[6365] Fix | Delete
var showdown = __webpack_require__("M55E");
[6366] Fix | Delete
var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown);
[6367] Fix | Delete
[6368] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js
[6369] Fix | Delete
/**
[6370] Fix | Delete
* External dependencies
[6371] Fix | Delete
*/
[6372] Fix | Delete
// Reuse the same showdown converter.
[6373] Fix | Delete
[6374] Fix | Delete
var converter = new showdown_default.a.Converter({
[6375] Fix | Delete
noHeaderId: true,
[6376] Fix | Delete
tables: true,
[6377] Fix | Delete
literalMidWordUnderscores: true,
[6378] Fix | Delete
omitExtraWLInCodeBlocks: true,
[6379] Fix | Delete
simpleLineBreaks: true,
[6380] Fix | Delete
strikethrough: true
[6381] Fix | Delete
});
[6382] Fix | Delete
/**
[6383] Fix | Delete
* Corrects the Slack Markdown variant of the code block.
[6384] Fix | Delete
* If uncorrected, it will be converted to inline code.
[6385] Fix | Delete
*
[6386] Fix | Delete
* @see https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages-#code-blocks
[6387] Fix | Delete
*
[6388] Fix | Delete
* @param {string} text The potential Markdown text to correct.
[6389] Fix | Delete
*
[6390] Fix | Delete
* @return {string} The corrected Markdown.
[6391] Fix | Delete
*/
[6392] Fix | Delete
[6393] Fix | Delete
function slackMarkdownVariantCorrector(text) {
[6394] Fix | Delete
return text.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, function (match, p1, p2, p3) {
[6395] Fix | Delete
return "".concat(p1, "\n").concat(p2, "\n").concat(p3);
[6396] Fix | Delete
});
[6397] Fix | Delete
}
[6398] Fix | Delete
/**
[6399] Fix | Delete
* Converts a piece of text into HTML based on any Markdown present.
[6400] Fix | Delete
* Also decodes any encoded HTML.
[6401] Fix | Delete
*
[6402] Fix | Delete
* @param {string} text The plain text to convert.
[6403] Fix | Delete
*
[6404] Fix | Delete
* @return {string} HTML.
[6405] Fix | Delete
*/
[6406] Fix | Delete
[6407] Fix | Delete
[6408] Fix | Delete
function markdownConverter(text) {
[6409] Fix | Delete
return converter.makeHtml(slackMarkdownVariantCorrector(text));
[6410] Fix | Delete
}
[6411] Fix | Delete
[6412] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js
[6413] Fix | Delete
/**
[6414] Fix | Delete
* Removes iframes.
[6415] Fix | Delete
*
[6416] Fix | Delete
* @param {Node} node The node to check.
[6417] Fix | Delete
*
[6418] Fix | Delete
* @return {void}
[6419] Fix | Delete
*/
[6420] Fix | Delete
function iframeRemover(node) {
[6421] Fix | Delete
if (node.nodeName === 'IFRAME') {
[6422] Fix | Delete
var text = node.ownerDocument.createTextNode(node.src);
[6423] Fix | Delete
node.parentNode.replaceChild(text, node);
[6424] Fix | Delete
}
[6425] Fix | Delete
}
[6426] Fix | Delete
[6427] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js
[6428] Fix | Delete
/**
[6429] Fix | Delete
* WordPress dependencies
[6430] Fix | Delete
*/
[6431] Fix | Delete
[6432] Fix | Delete
function googleDocsUIdRemover(node) {
[6433] Fix | Delete
if (!node.id || node.id.indexOf('docs-internal-guid-') !== 0) {
[6434] Fix | Delete
return;
[6435] Fix | Delete
}
[6436] Fix | Delete
[6437] Fix | Delete
Object(external_wp_dom_["unwrap"])(node);
[6438] Fix | Delete
}
[6439] Fix | Delete
[6440] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js
[6441] Fix | Delete
[6442] Fix | Delete
[6443] Fix | Delete
[6444] Fix | Delete
function raw_handling_utils_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; }
[6445] Fix | Delete
[6446] Fix | Delete
function raw_handling_utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { raw_handling_utils_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 { raw_handling_utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[6447] Fix | Delete
[6448] Fix | Delete
/**
[6449] Fix | Delete
* External dependencies
[6450] Fix | Delete
*/
[6451] Fix | Delete
[6452] Fix | Delete
/**
[6453] Fix | Delete
* WordPress dependencies
[6454] Fix | Delete
*/
[6455] Fix | Delete
[6456] Fix | Delete
[6457] Fix | Delete
/**
[6458] Fix | Delete
* Internal dependencies
[6459] Fix | Delete
*/
[6460] Fix | Delete
[6461] Fix | Delete
[6462] Fix | Delete
[6463] Fix | Delete
function getBlockContentSchemaFromTransforms(transforms, context) {
[6464] Fix | Delete
var phrasingContentSchema = Object(external_wp_dom_["getPhrasingContentSchema"])(context);
[6465] Fix | Delete
var schemaArgs = {
[6466] Fix | Delete
phrasingContentSchema: phrasingContentSchema,
[6467] Fix | Delete
isPaste: context === 'paste'
[6468] Fix | Delete
};
[6469] Fix | Delete
var schemas = transforms.map(function (_ref) {
[6470] Fix | Delete
var isMatch = _ref.isMatch,
[6471] Fix | Delete
blockName = _ref.blockName,
[6472] Fix | Delete
schema = _ref.schema;
[6473] Fix | Delete
var hasAnchorSupport = registration_hasBlockSupport(blockName, 'anchor');
[6474] Fix | Delete
schema = Object(external_lodash_["isFunction"])(schema) ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
[6475] Fix | Delete
// provides an isMatch we can return the schema right away.
[6476] Fix | Delete
[6477] Fix | Delete
if (!hasAnchorSupport && !isMatch) {
[6478] Fix | Delete
return schema;
[6479] Fix | Delete
}
[6480] Fix | Delete
[6481] Fix | Delete
return Object(external_lodash_["mapValues"])(schema, function (value) {
[6482] Fix | Delete
var attributes = value.attributes || []; // If the block supports the "anchor" functionality, it needs to keep its ID attribute.
[6483] Fix | Delete
[6484] Fix | Delete
if (hasAnchorSupport) {
[6485] Fix | Delete
attributes = [].concat(Object(toConsumableArray["a" /* default */])(attributes), ['id']);
[6486] Fix | Delete
}
[6487] Fix | Delete
[6488] Fix | Delete
return raw_handling_utils_objectSpread(raw_handling_utils_objectSpread({}, value), {}, {
[6489] Fix | Delete
attributes: attributes,
[6490] Fix | Delete
isMatch: isMatch ? isMatch : undefined
[6491] Fix | Delete
});
[6492] Fix | Delete
});
[6493] Fix | Delete
});
[6494] Fix | Delete
return external_lodash_["mergeWith"].apply(void 0, [{}].concat(Object(toConsumableArray["a" /* default */])(schemas), [function (objValue, srcValue, key) {
[6495] Fix | Delete
switch (key) {
[6496] Fix | Delete
case 'children':
[6497] Fix | Delete
{
[6498] Fix | Delete
if (objValue === '*' || srcValue === '*') {
[6499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function