/******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ autop: () => (/* binding */ autop), /* harmony export */ removep: () => (/* binding */ removep) /* harmony export */ }); const htmlSplitRegex = (() => { const comments = "!(?:-(?!->)[^\\-]*)*(?:-->)?"; const cdata = "!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?"; const escaped = "(?=!--|!\\[CDATA\\[)((?=!-)" + // If yes, which type? comments + "|" + cdata + ")"; const regex = "(<(" + // Conditional expression follows. escaped + // Find end of escaped element. "|[^>]*>?))"; return new RegExp(regex); })(); function htmlSplit(input) { const parts = []; let workingInput = input; let match; while (match = workingInput.match(htmlSplitRegex)) { const index = match.index; parts.push(workingInput.slice(0, index)); parts.push(match[0]); workingInput = workingInput.slice(index + match[0].length); } if (workingInput.length) { parts.push(workingInput); } return parts; } function replaceInHtmlTags(haystack, replacePairs) { const textArr = htmlSplit(haystack); let changed = false; const needles = Object.keys(replacePairs); for (let i = 1; i < textArr.length; i += 2) { for (let j = 0; j < needles.length; j++) { const needle = needles[j]; if (-1 !== textArr[i].indexOf(needle)) { textArr[i] = textArr[i].replace( new RegExp(needle, "g"), replacePairs[needle] ); changed = true; break; } } } if (changed) { haystack = textArr.join(""); } return haystack; } function autop(text, br = true) { const preTags = []; if (text.trim() === "") { return ""; } text = text + "\n"; if (text.indexOf("
");
const lastText = textParts.pop();
text = "";
for (let i = 0; i < textParts.length; i++) {
const textPart = textParts[i];
const start = textPart.indexOf("";
preTags.push([name, textPart.substr(start) + ""]);
text += textPart.substr(0, start) + name;
}
text += lastText;
}
text = text.replace(/" + textPiece.replace(/^\n*|\n*$/g, "") + "
\n"; }); text = text.replace(/\s*<\/p>/g, ""); text = text.replace( /
([^<]+)<\/(div|address|form)>/g, "
$1
$2>" ); text = text.replace( new RegExp("\\s*(?" + allBlocks + "[^>]*>)\\s*
", "g"), "$1" ); text = text.replace(/(
]*)>/gi, ""); text = text.replace( new RegExp(""); text = text.replace(/<\/blockquote><\/p>/g, "
\\s*(?" + allBlocks + "[^>]*>)", "g"), "$1" ); text = text.replace( new RegExp("(?" + allBlocks + "[^>]*>)\\s*
", "g"), "$1" ); if (br) { text = text.replace( /<(script|style).*?<\/\\1>/g, (match) => match[0].replace(/\n/g, "") ); text = text.replace(/
|
/g, "
"); text = text.replace( /(
)?\s*\n/g, (a, b) => b ? a : "
\n" ); text = text.replace(//g, "\n"); } text = text.replace( new RegExp("(?" + allBlocks + "[^>]*>)\\s*
", "g"), "$1" ); text = text.replace( /
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g, "$1" ); text = text.replace(/\n<\/p>$/g, ""); preTags.forEach((preTag) => { const [name, original] = preTag; text = text.replace(name, original); }); if (-1 !== text.indexOf("")) { text = text.replace(/\s?\s?/g, "\n"); } return text; } function removep(html) { const blocklist = "blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure"; const blocklist1 = blocklist + "|div|p"; const blocklist2 = blocklist + "|pre"; const preserve = []; let preserveLinebreaks = false; let preserveBr = false; if (!html) { return ""; } if (html.indexOf("