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.

25 lines
16 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/mdast-util-gfm-task-list-item";
exports.ids = ["vendor-chunks/mdast-util-gfm-task-list-item"];
exports.modules = {
/***/ "(ssr)/./node_modules/mdast-util-gfm-task-list-item/lib/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/mdast-util-gfm-task-list-item/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 */ gfmTaskListItemFromMarkdown: () => (/* binding */ gfmTaskListItemFromMarkdown),\n/* harmony export */ gfmTaskListItemToMarkdown: () => (/* binding */ gfmTaskListItemToMarkdown)\n/* harmony export */ });\n/* harmony import */ var mdast_util_to_markdown_lib_handle_list_item_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mdast-util-to-markdown/lib/handle/list-item.js */ \"(ssr)/./node_modules/mdast-util-to-markdown/lib/handle/list-item.js\");\n/* harmony import */ var mdast_util_to_markdown_lib_util_track_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mdast-util-to-markdown/lib/util/track.js */ \"(ssr)/./node_modules/mdast-util-to-markdown/lib/util/track.js\");\n/**\n * @typedef {import('mdast').Content} Content\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast').Parent} Parent\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */ /**\n * @typedef {Extract<Root | Content, Parent>} Parents\n */ \n\n// To do: next major: rename `context` -> `state`, `safeOptions` -> `info`, use\n// `track` from `state`.\n// To do: next major: replace exports with functions.\n// To do: next major: use `defaulthandlers.listItem`.\n/**\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n *\n * @type {FromMarkdownExtension}\n */ const gfmTaskListItemFromMarkdown = {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n};\n/**\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n *\n * @type {ToMarkdownExtension}\n */ const gfmTaskListItemToMarkdown = {\n unsafe: [\n {\n atBreak: true,\n character: \"-\",\n after: \"[:|-]\"\n }\n ],\n handlers: {\n listItem: listItemWithTaskListItem\n }\n};\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */ function exitCheck(token) {\n const node = /** @type {ListItem} */ this.stack[this.stack.length - 2];\n // Were always in a paragraph, in a list item.\n node.checked = token.type === \"taskListCheckValueChecked\";\n}\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */ function exitParagraphWithTaskListItem(token) {\n const parent = /** @type {Parents} */ this.stack[this.stack.length - 2];\n if (parent && parent.type === \"listItem\" && typeof parent.checked === \"boolean\") {\n const node = /** @type {Paragraph} */ this.stack[this.stack.length - 1];\n const head = node.children[0];\n if (head && head.type === \"text\") {\n const siblings = parent.children;\n let index = -1;\n /** @type {Paragraph | undefined} */ let firstParaghraph;\n while(++index < siblings.length){\n const sibling = siblings[index];\n if (sibling.type === \"paragraph\") {\n firstParaghraph = sibling;\n break;\n }\n }\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1);\n if (head.value.length === 0) {\n node.children.shift();\n } else if (node.position && head.position && typeof head.position.start.offset === \"number\") {\n head.position.start.column++;\n head.position.start.offset++;\n node.position.st
/***/ })
};
;