: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return pieces.map(piece => {
// Already a block from shortcode.
if (typeof piece !== 'string') {
// These filters are essential for some blocks to be able to transform
// from raw HTML. These filters move around some content or add
// additional tags, they do not remove any content.
// Needed to adjust invalid lists.
// Needed to create more and nextpage blocks.
// Needed to create media blocks.
// Needed to create the quote block, which cannot handle text
// without wrapper paragraphs.
piece = deepFilterHTML(piece, filters, blockContentSchema);
piece = normaliseBlocks(piece, {
return htmlToBlocks(piece, rawHandler);
}).flat().filter(Boolean);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
* Looks for comments, and removes them.
* @param {Node} node The node to be processed.
function commentRemover(node) {
if (node.nodeType === node.COMMENT_NODE) {
(0,external_wp_dom_namespaceObject.remove)(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
* Checks if the given node should be considered inline content, optionally
* depending on a context tag.
* @param {Node} node Node name.
* @param {string} contextTag Tag name.
* @return {boolean} True if the node is inline content, false if nohe.
function isInline(node, contextTag) {
if ((0,external_wp_dom_namespaceObject.isTextContent)(node)) {
const tag = node.nodeName.toLowerCase();
const inlineAllowedTagGroups = [['ul', 'li', 'ol'], ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']];
return inlineAllowedTagGroups.some(tagGroup => [tag, contextTag].filter(t => !tagGroup.includes(t)).length === 0);
function deepCheck(nodes, contextTag) {
return nodes.every(node => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag));
function isDoubleBR(node) {
return node.nodeName === 'BR' && node.previousSibling && node.previousSibling.nodeName === 'BR';
function isInlineContent(HTML, contextTag) {
const doc = document.implementation.createHTMLDocument('');
doc.body.innerHTML = HTML;
const nodes = Array.from(doc.body.children);
return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js
function phrasingContentReducer(node, doc) {
// In jsdom-jscore, 'node.style' can be null.
// TODO: Explore fixing this by patching jsdom-jscore.
if (node.nodeName === 'SPAN' && node.style) {
if (fontWeight === 'bold' || fontWeight === '700') {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('strong'), node);
if (fontStyle === 'italic') {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('em'), node);
// Some DOM implementations (Safari, JSDom) don't support
// style.textDecorationLine, so we check style.textDecoration as a
if (textDecorationLine === 'line-through' || textDecoration.includes('line-through')) {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('s'), node);
if (verticalAlign === 'super') {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('sup'), node);
} else if (verticalAlign === 'sub') {
(0,external_wp_dom_namespaceObject.wrap)(doc.createElement('sub'), node);
} else if (node.nodeName === 'B') {
node = (0,external_wp_dom_namespaceObject.replaceTag)(node, 'strong');
} else if (node.nodeName === 'I') {
node = (0,external_wp_dom_namespaceObject.replaceTag)(node, 'em');
} else if (node.nodeName === 'A') {
// In jsdom-jscore, 'node.target' can be null.
// TODO: Explore fixing this by patching jsdom-jscore.
if (node.target && node.target.toLowerCase() === '_blank') {
node.rel = 'noreferrer noopener';
node.removeAttribute('target');
node.removeAttribute('rel');
// Saves anchor elements name attribute as id
if (node.name && !node.id) {
// Keeps id only if there is an internal link pointing to it
if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) {
node.removeAttribute('id');
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js
function headRemover(node) {
if (node.nodeName !== 'SCRIPT' && node.nodeName !== 'NOSCRIPT' && node.nodeName !== 'TEMPLATE' && node.nodeName !== 'STYLE') {
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-ignore.js
* Looks for comments, and removes them.
* @param {Node} node The node to be processed.
function msListIgnore(node) {
if (node.nodeType !== node.ELEMENT_NODE) {
const style = node.getAttribute('style');
if (!style || !style.includes('mso-list')) {
const rules = style.split(';').reduce((acc, rule) => {
const [key, value] = rule.split(':');
acc[key.trim().toLowerCase()] = value.trim().toLowerCase();
if (rules['mso-list'] === 'ignore') {
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js
function ms_list_converter_isList(node) {
return node.nodeName === 'OL' || node.nodeName === 'UL';
function msListConverter(node, doc) {
if (node.nodeName !== 'P') {
const style = node.getAttribute('style');
if (!style || !style.includes('mso-list')) {
const prevNode = node.previousElementSibling;
// Add new list if no previous.
if (!prevNode || !ms_list_converter_isList(prevNode)) {
// See https://html.spec.whatwg.org/multipage/grouping-content.html#attr-ol-type.
const type = node.textContent.trim().slice(0, 1);
const isNumeric = /[1iIaA]/.test(type);
const newListNode = doc.createElement(isNumeric ? 'ol' : 'ul');
newListNode.setAttribute('type', type);
node.parentNode.insertBefore(newListNode, node);
const listNode = node.previousElementSibling;
const listType = listNode.nodeName;
const listItem = doc.createElement('li');
let receivingNode = listNode;
listItem.innerHTML = deepFilterHTML(node.innerHTML, [msListIgnore]);
const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0;
// Change pointer depending on indentation level.
receivingNode = receivingNode.lastChild || receivingNode;
// If it's a list, move pointer to the last item.
if (ms_list_converter_isList(receivingNode)) {
receivingNode = receivingNode.lastChild || receivingNode;
// Make sure we append to a list.
if (!ms_list_converter_isList(receivingNode)) {
receivingNode = receivingNode.appendChild(doc.createElement(listType));
// Append the list item to the list.
receivingNode.appendChild(listItem);
// Remove the wrapper paragraph.
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js
function imageCorrector(node) {
if (node.nodeName !== 'IMG') {
if (node.src.indexOf('file:') === 0) {
// This piece cannot be tested outside a browser env.
if (node.src.indexOf('data:') === 0) {
const [properties, data] = node.src.split(',');
const [type] = properties.slice(5).split(';');
// Can throw DOMException!
const uint8Array = new Uint8Array(decoded.length);
for (let i = 0; i < uint8Array.length; i++) {
uint8Array[i] = decoded.charCodeAt(i);
const name = type.replace('/', '.');
const file = new window.File([uint8Array], name, {
node.src = (0,external_wp_blob_namespaceObject.createBlobURL)(file);
// Remove trackers and hardly visible images.
if (node.height === 1 || node.width === 1) {
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/div-normaliser.js
function divNormaliser(node) {
if (node.nodeName !== 'DIV') {
node.innerHTML = normaliseBlocks(node.innerHTML);
// EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js
var showdown = __webpack_require__(1030);
var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js
// Reuse the same showdown converter.
const converter = new (showdown_default()).Converter({
literalMidWordUnderscores: true,
omitExtraWLInCodeBlocks: true,
* Corrects the Slack Markdown variant of the code block.
* If uncorrected, it will be converted to inline code.
* @see https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages-#code-blocks
* @param {string} text The potential Markdown text to correct.
* @return {string} The corrected Markdown.
function slackMarkdownVariantCorrector(text) {
return text.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, (match, p1, p2, p3) => `${p1}\n${p2}\n${p3}`);
function bulletsToAsterisks(text) {
return text.replace(/(^|\n)•( +)/g, '$1*$2');
* Converts a piece of text into HTML based on any Markdown present.
* Also decodes any encoded HTML.
* @param {string} text The plain text to convert.
function markdownConverter(text) {
return converter.makeHtml(slackMarkdownVariantCorrector(bulletsToAsterisks(text)));
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js
* @param {Node} node The node to check.
function iframeRemover(node) {
if (node.nodeName === 'IFRAME') {
const text = node.ownerDocument.createTextNode(node.src);
node.parentNode.replaceChild(text, node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js
function googleDocsUIdRemover(node) {
if (!node.id || node.id.indexOf('docs-internal-guid-') !== 0) {
// Google Docs sometimes wraps the content in a B tag. We don't want to keep
if (node.tagName === 'B') {
(0,external_wp_dom_namespaceObject.unwrap)(node);
node.removeAttribute('id');
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js
function isFormattingSpace(character) {
return character === ' ' || character === '\r' || character === '\n' || character === '\t';
* Removes spacing that formats HTML.
* @see https://www.w3.org/TR/css-text-3/#white-space-processing
* @param {Node} node The node to be processed.
function htmlFormattingRemover(node) {
if (node.nodeType !== node.TEXT_NODE) {
// Ignore pre content. Note that this does not use Element#closest due to
// a combination of (a) node may not be Element and (b) node.parentElement
// does not have full support in all browsers (Internet Exporer).
// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement#Browser_compatibility
while (parent = parent.parentNode) {
if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === 'PRE') {
// First, replace any sequence of HTML formatting space with a single space.
let newData = node.data.replace(/[ \r\n\t]+/g, ' ');
// Remove the leading space if the text element is at the start of a block,
// is preceded by a line break element, or has a space in the previous
if (newData[0] === ' ') {
const previousSibling = getSibling(node, 'previous');
if (!previousSibling || previousSibling.nodeName === 'BR' || previousSibling.textContent.slice(-1) === ' ') {
newData = newData.slice(1);
// Remove the trailing space if the text element is at the end of a block,
// is succeded by a line break element, or has a space in the next text
if (newData[newData.length - 1] === ' ') {
const nextSibling = getSibling(node, 'next');
if (!nextSibling || nextSibling.nodeName === 'BR' || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
newData = newData.slice(0, -1);
// If there's no data left, remove the node, so `previousSibling` stays
// accurate. Otherwise, update the node data.
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js
* Removes trailing br elements from text-level content.
* @param {Element} node Node to check.
function brRemover(node) {
if (node.nodeName !== 'BR') {
if (getSibling(node, 'next')) {
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js
* Removes empty paragraph elements.
* @param {Element} node Node to check.
function emptyParagraphRemover(node) {
if (node.nodeName !== 'P') {
if (node.hasChildNodes()) {
node.parentNode.removeChild(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/slack-paragraph-corrector.js
* Replaces Slack paragraph markup with a double line break (later converted to
* @param {Element} node Node to check.
function slackParagraphCorrector(node) {
if (node.nodeName !== 'SPAN') {