|
|
|
|
|
"use strict";
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ATTENTION: An "eval-source-map" devtool has been used.
|
|
|
|
|
|
* This devtool is neither made for production nor for readable output files.
|
|
|
|
|
|
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
|
|
|
|
|
|
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
|
|
|
|
* or disable the default devtool with "devtool: false".
|
|
|
|
|
|
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
|
|
|
|
*/
|
|
|
|
|
|
exports.id = "vendor-chunks/micromark-util-sanitize-uri";
|
|
|
|
|
|
exports.ids = ["vendor-chunks/micromark-util-sanitize-uri"];
|
|
|
|
|
|
exports.modules = {
|
|
|
|
|
|
|
|
|
|
|
|
/***/ "(ssr)/./node_modules/micromark-util-sanitize-uri/dev/index.js":
|
|
|
|
|
|
/*!***************************************************************!*\
|
|
|
|
|
|
!*** ./node_modules/micromark-util-sanitize-uri/dev/index.js ***!
|
|
|
|
|
|
\***************************************************************/
|
|
|
|
|
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ normalizeUri: () => (/* binding */ normalizeUri),\n/* harmony export */ sanitizeUri: () => (/* binding */ sanitizeUri)\n/* harmony export */ });\n/* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ \"(ssr)/./node_modules/micromark-util-character/dev/index.js\");\n/* harmony import */ var micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-encode */ \"(ssr)/./node_modules/micromark-util-encode/index.js\");\n/* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ \"(ssr)/./node_modules/micromark-util-symbol/codes.js\");\n/* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/values.js */ \"(ssr)/./node_modules/micromark-util-symbol/values.js\");\n\n\n\n\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri` below).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * Then, a regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`,\n * or `/^https?$/i` for `img[src]`.\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string|undefined} url\n * @param {RegExp} [protocol]\n * @returns {string}\n */ function sanitizeUri(url, protocol) {\n const value = (0,micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__.encode)(normalizeUri(url || \"\"));\n if (!protocol) {\n return value;\n }\n const colon = value.indexOf(\":\");\n const questionMark = value.indexOf(\"?\");\n const numberSign = value.indexOf(\"#\");\n const slash = value.indexOf(\"/\");\n if (// If there is no protocol, it’s relative.\n colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign || // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))) {\n return value;\n }\n return \"\";\n}\n/**\n * Normalize a URL (such as used in definitions).\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * @returns {string}\n */ function normalizeUri(value) {\n /** @type {Array<string>} */ const result = [];\n let index = -1;\n let start = 0;\n let skip = 0;\n while(++index < value.length){\n const code = value.charCodeAt(index);\n /** @type {string} */ let replace = \"\";\n // A correct percent encoded value.\n if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.percentSign && (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 1)) && (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 2))) {\n skip = 2;\n } else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code);\n }\n } else if (code > 55295 && code < 57344) {\n const next = value.charCodeAt(index + 1);\n // A correct surrogate pair.\n if (code < 56320 && next > 56319 && next < 57344) {\n replace = String.fromCharCode(code, next);\n skip = 1;\n } else {\n replace = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__.values.replacementCharac
|
|
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
;
|