You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			35 lines
		
	
	
		
			52 KiB
		
	
	
	
		
			JavaScript
		
	
		
		
			
		
	
	
			35 lines
		
	
	
		
			52 KiB
		
	
	
	
		
			JavaScript
		
	
| 
											9 months ago
										 | "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/hast-util-from-html"; | ||
|  | exports.ids = ["vendor-chunks/hast-util-from-html"]; | ||
|  | exports.modules = { | ||
|  | 
 | ||
|  | /***/ "(ssr)/./node_modules/hast-util-from-html/lib/errors.js": | ||
|  | /*!********************************************************!*\ | ||
|  |   !*** ./node_modules/hast-util-from-html/lib/errors.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 */   errors: () => (/* binding */ errors)\n/* harmony export */ });\nconst errors = {\n    abandonedHeadElementChild: {\n        reason: \"Unexpected metadata element after head\",\n        description: \"Unexpected element after head. Expected the element before `</head>`\",\n        url: false\n    },\n    abruptClosingOfEmptyComment: {\n        reason: \"Unexpected abruptly closed empty comment\",\n        description: \"Unexpected `>` or `->`. Expected `-->` to close comments\"\n    },\n    abruptDoctypePublicIdentifier: {\n        reason: \"Unexpected abruptly closed public identifier\",\n        description: \"Unexpected `>`. Expected a closing `\\\"` or `'` after the public identifier\"\n    },\n    abruptDoctypeSystemIdentifier: {\n        reason: \"Unexpected abruptly closed system identifier\",\n        description: \"Unexpected `>`. Expected a closing `\\\"` or `'` after the identifier identifier\"\n    },\n    absenceOfDigitsInNumericCharacterReference: {\n        reason: \"Unexpected non-digit at start of numeric character reference\",\n        description: \"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references\"\n    },\n    cdataInHtmlContent: {\n        reason: \"Unexpected CDATA section in HTML\",\n        description: \"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead\"\n    },\n    characterReferenceOutsideUnicodeRange: {\n        reason: \"Unexpected too big numeric character reference\",\n        description: \"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)\"\n    },\n    closingOfElementWithOpenChildElements: {\n        reason: \"Unexpected closing tag with open child elements\",\n        description: \"Unexpectedly closing tag. Expected other tags to be closed first\",\n        url: false\n    },\n    controlCharacterInInputStream: {\n        reason: \"Unexpected control character\",\n        description: \"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace\"\n    },\n    controlCharacterReference: {\n        reason: \"Unexpected control character reference\",\n        description: \"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace\"\n    },\n    disallowedContentInNoscriptInHead: {\n        reason: \"Disallowed content inside `<noscript>` in `<head>`\",\n        description: \"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`\",\n        url: false\n    },\n    duplicateAttribute: {\n        reason: \"Unexpected duplicate attribute\",\n        description: \"Unexpectedly double attribute. Expected attributes to occur only once\"\n    },\n    endTagWithAttributes: {\n        reason: \"Unexpected attribute on closing tag\",\n        description: \"Unexpected attribute. Expected `>` instead\"\n    },\n    endTagWithTrailingSolidus: {\n        reason: \"Unexpected slash at end of closing tag\",\n        description: \"Unexpected `%c-1`. Expected `>` instead\"\n    },\n    endTagWithoutMatchingOpenElement: {\n        reason: \"Unexpected unopened end tag\",\n        description: \"Unexpected end tag. Expected no end tag or another end tag\",\n        url: false\n    },\n    eofBeforeTagName: {\n        reason: \"Unexpected end of file\",\n        description: \"Unexpected end of file. Expected tag name instead\"\n    },\n    eofInCdata: {\n        reason: \"Unexpected end of file in CDATA\",\n        description: \"Unexpected end of file. Expected `]]>` to close the CDATA\"\n    },\n    eofInComment: {\n        reason: \"Unexpected end of file in comment\",\n        description: \"Unexpected end of file. Expected `-->` to close the comment\"\n    },\n    eofInDoctype: {\n        reason: \"Unexpected end of file in doctype\",\n        description: \"Unexpected end of file. Expe | ||
|  | 
 | ||
|  | /***/ }), | ||
|  | 
 | ||
|  | /***/ "(ssr)/./node_modules/hast-util-from-html/lib/index.js": | ||
|  | /*!*******************************************************!*\ | ||
|  |   !*** ./node_modules/hast-util-from-html/lib/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 */   fromHtml: () => (/* binding */ fromHtml)\n/* harmony export */ });\n/* harmony import */ var parse5__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parse5 */ \"(ssr)/./node_modules/parse5/dist/index.js\");\n/* harmony import */ var vfile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vfile */ \"(ssr)/./node_modules/vfile/lib/index.js\");\n/* harmony import */ var vfile_message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vfile-message */ \"(ssr)/./node_modules/vfile-message/lib/index.js\");\n/* harmony import */ var hast_util_from_parse5__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! hast-util-from-parse5 */ \"(ssr)/./node_modules/hast-util-from-parse5/lib/index.js\");\n/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./errors.js */ \"(ssr)/./node_modules/hast-util-from-html/lib/errors.js\");\n/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('vfile').VFileCompatible} VFileCompatible\n */ /**\n * @typedef {Pick<import('hast-util-from-parse5').Options, 'space' | 'verbose'>} FromParse5Options\n *\n * @typedef {keyof errors} ErrorCode\n *   Known names of parse errors.\n * @typedef {0 | 1 | 2 | boolean} ErrorSeverity\n *   Error severity:\n *\n *   * `0` or `false`\n *     — turn the parse error off\n *   * `1` or `true`\n *     — turn the parse error into a warning\n *   * `2`\n *     — turn the parse error into an actual error: processing stops.\n * @typedef {Partial<Record<ErrorCode, ErrorSeverity | null | undefined>>} ErrorFields\n *   Error configuration.\n *\n * @typedef Error\n *   Error from `parse5`.\n * @property {string} code\n * @property {number} startLine\n * @property {number} startCol\n * @property {number} startOffset\n * @property {number} endLine\n * @property {number} endCol\n * @property {number} endOffset\n *\n * @callback OnError\n *   Handle errors.\n * @param {VFileMessage} error\n *   Message.\n * @returns {void}\n *   Nothing.\n *\n * @typedef ParseFields\n * @property {boolean | null | undefined} [fragment=false]\n *   Specify whether to parse a fragment, instead of a complete document.\n *\n *   In document mode, unopened `html`, `head`, and `body` elements are opened\n *   in just the right places.\n * @property {OnError | null | undefined} [onerror]\n *   Call `onerror` with parse errors while parsing.\n *\n *   > 👉 **Note**: parse errors are currently being added to HTML.\n *   > Not all errors emitted by parse5 (or us) are specced yet.\n *   > Some documentation may still be missing.\n *\n *   Specific rules can be turned off by setting them to `false` (or `0`).\n *   The default, when `emitParseErrors: true`, is `true` (or `1`), and means\n *   that rules emit as warnings.\n *   Rules can also be configured with `2`, to turn them into fatal errors.\n *\n * @typedef {FromParse5Options & ParseFields & ErrorFields} Options\n *   Configuration.\n */ \n\n\n\n\nconst base = \"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-\";\nconst fatalities = {\n    2: true,\n    1: false,\n    0: null\n};\n/**\n * Turn serialized HTML into a hast tree.\n *\n * @param {VFileCompatible} value\n *   Serialized HTML to parse.\n * @param {Options | null | undefined} [options={}]\n *   Configuration (optional).\n * @returns {Root}\n *   Tree.\n */ function fromHtml(value, options) {\n    const settings = options || {};\n    const warn = settings.onerror || null;\n    const file = value instanceof vfile__WEBPACK_IMPORTED_MODULE_1__.VFile ? value : new vfile__WEBPACK_IMPORTED_MODULE_1__.VFile(value);\n    const fn = settings.fragment ? parse5__WEBPACK_IMPORTED_MODULE_0__.parseFragment : parse5__WEBPACK_IMPORTED_MODULE_0__.parse;\n    const doc = String(file);\n    const p5doc = fn(doc, {\n        sourceCodeLocationInfo: true,\n        onParseError: settings.onerror ? onerror : null,\n        scriptingEnabled: false\n    });\n    // @ts-expect-error: `parse5` retur
 | ||
|  | 
 | ||
|  | /***/ }) | ||
|  | 
 | ||
|  | }; | ||
|  | ; |