@readme/markdown 13.6.0 → 13.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.node.js CHANGED
@@ -19019,6 +19019,7 @@ __webpack_require__.r(__webpack_exports__);
19019
19019
  // EXPORTS
19020
19020
  __webpack_require__.d(__webpack_exports__, {
19021
19021
  Components: () => (/* reexport */ components_namespaceObject),
19022
+ FLOW_TYPES: () => (/* reexport */ FLOW_TYPES),
19022
19023
  Owlmoji: () => (/* reexport */ Owlmoji),
19023
19024
  compile: () => (/* reexport */ lib_compile),
19024
19025
  exports: () => (/* reexport */ lib_exports),
@@ -25091,6 +25092,28 @@ const parseOptions = (userOpts = {}) => {
25091
25092
  return opts;
25092
25093
  };
25093
25094
 
25095
+ ;// ./lib/constants.ts
25096
+ /**
25097
+ * Pattern to match component tags (PascalCase or snake_case)
25098
+ */
25099
+ const componentTagPattern = /<(\/?[A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>/g;
25100
+ /**
25101
+ * MDAST flow (block-level) content types that cannot be represented
25102
+ * inside GFM table cells. Used to decide whether a table should be
25103
+ * serialized as GFM or as JSX `<Table>` syntax.
25104
+ *
25105
+ * @see https://github.com/syntax-tree/mdast#flowcontent
25106
+ */
25107
+ const FLOW_TYPES = new Set([
25108
+ 'blockquote',
25109
+ 'code',
25110
+ 'heading',
25111
+ 'html',
25112
+ 'list',
25113
+ 'table',
25114
+ 'thematicBreak',
25115
+ ]);
25116
+
25094
25117
  ;// ./node_modules/github-slugger/regex.js
25095
25118
  // This module is generated by `script/`.
25096
25119
  /* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
@@ -73207,6 +73230,10 @@ const plain = (node, opts = {}) => {
73207
73230
  };
73208
73231
  /* harmony default export */ const lib_plain = (plain);
73209
73232
 
73233
+ ;// ./processor/compile/variable.ts
73234
+ const variable = (node) => `{user.${node.data?.hProperties?.name || ''}}`;
73235
+ /* harmony default export */ const compile_variable = (variable);
73236
+
73210
73237
  ;// ./processor/transform/extract-text.ts
73211
73238
  /**
73212
73239
  * Extracts text content from a single AST node recursively.
@@ -73218,7 +73245,7 @@ const plain = (node, opts = {}) => {
73218
73245
  * @returns The concatenated text content
73219
73246
  */
73220
73247
  const extractText = (node) => {
73221
- if (node.type === 'text' && typeof node.value === 'string') {
73248
+ if ((node.type === 'text' || node.type === 'html') && typeof node.value === 'string') {
73222
73249
  return node.value;
73223
73250
  }
73224
73251
  // When a blockquote contains only an image (no text), treat it as having content
@@ -73251,8 +73278,18 @@ const extractText = (node) => {
73251
73278
 
73252
73279
 
73253
73280
 
73281
+
73282
+
73254
73283
  const titleParser = unified().use(remarkParse).use(remarkGfm);
73255
- const toMarkdownExtensions = [gfmStrikethroughToMarkdown()];
73284
+ // The title paragraph may contain custom AST nodes that `toMarkdown` doesn't
73285
+ // natively understand
73286
+ const toMarkdownExtensions = [
73287
+ gfmStrikethroughToMarkdown(),
73288
+ // For mdx variable syntaxes (e.g., {user.name})
73289
+ mdxExpressionToMarkdown(),
73290
+ // Important: This is required and would crash the parser if there's no variable node handler
73291
+ { handlers: { [NodeTypes.variable]: compile_variable } },
73292
+ ];
73256
73293
  const callouts_regex = `^(${emoji_regex().source}|⚠)(\\s+|$)`;
73257
73294
  const findFirst = (node) => {
73258
73295
  if ('children' in node)
@@ -91073,693 +91110,348 @@ const mdxToHast = () => tree => {
91073
91110
  };
91074
91111
  /* harmony default export */ const mdx_to_hast = (mdxToHast);
91075
91112
 
91076
- ;// ./lib/mdast-util/empty-task-list-item/index.ts
91113
+ ;// ./processor/transform/mdxish/normalize-malformed-md-syntax.ts
91114
+
91115
+ // Marker patterns for multi-node emphasis detection
91116
+ const MARKER_PATTERNS = [
91117
+ { isBold: true, marker: '**' },
91118
+ { isBold: true, marker: '__' },
91119
+ { isBold: false, marker: '*' },
91120
+ { isBold: false, marker: '_' },
91121
+ ];
91122
+ // Patterns to detect for bold (** and __) and italic (* and _) syntax:
91123
+ // Bold: ** text**, **text **, word** text**, ** text **
91124
+ // Italic: * text*, *text *, word* text*, * text *
91125
+ // Same patterns for underscore variants
91126
+ // We use separate patterns for each marker type to allow this flexibility.
91127
+ // Pattern for ** bold **
91128
+ // Groups: 1=wordBefore, 2=marker, 3=contentWithSpaceAfter, 4=trailingSpace1, 5=contentWithSpaceBefore, 6=trailingSpace2, 7=afterChar
91129
+ // trailingSpace1 is for "** text **" pattern, trailingSpace2 is for "**text **" pattern
91130
+ const asteriskBoldRegex = /([^*\s]+)?\s*(\*\*)(?:\s+((?:[^*\n]|\*(?!\*))+?)(\s*)\2|((?:[^*\n]|\*(?!\*))+?)(\s+)\2)(\S|$)?/g;
91131
+ // Pattern for __ bold __
91132
+ const underscoreBoldRegex = /([^_\s]+)?\s*(__)(?:\s+((?:__(?! )|_(?!_)|[^_\n])+?)(\s*)\2|((?:__(?! )|_(?!_)|[^_\n])+?)(\s+)\2)(\S|$)?/g;
91133
+ // Pattern for * italic *
91134
+ const asteriskItalicRegex = /([^*\s]+)?\s*(\*)(?!\*)(?:\s+([^*\n]+?)(\s*)\2|([^*\n]+?)(\s+)\2)(\S|$)?/g;
91135
+ // Pattern for _ italic _
91136
+ const underscoreItalicRegex = /([^_\s]+)?\s*(_)(?!_)(?:\s+((?:[^_\n]|_(?! ))+?)(\s*)\2|((?:[^_\n]|_(?! ))+?)(\s+)\2)(\S|$)?/g;
91137
+ // CommonMark ignores intraword underscores or asteriks, but we want to italicize/bold the inner part
91138
+ // Pattern for intraword _word_ in words like hello_world_
91139
+ const intrawordUnderscoreItalicRegex = /(\w)_(?!_)([a-zA-Z0-9]+)_(?![\w_])/g;
91140
+ // Pattern for intraword __word__ in words like hello__world__
91141
+ const intrawordUnderscoreBoldRegex = /(\w)__([a-zA-Z0-9]+)__(?![\w_])/g;
91142
+ // Pattern for intraword *word* in words like hello*world*
91143
+ const intrawordAsteriskItalicRegex = /(\w)\*(?!\*)([a-zA-Z0-9]+)\*(?![\w*])/g;
91144
+ // Pattern for intraword **word** in words like hello**world**
91145
+ const intrawordAsteriskBoldRegex = /(\w)\*\*([a-zA-Z0-9]+)\*\*(?![\w*])/g;
91077
91146
  /**
91078
- * Normalizes list items that are written as only `[ ]` or `[x]` into GFM task
91079
- * list items during parse, but only when at least one whitespace character
91080
- * follows the closing bracket (`]`). This matches legacy behaviour for checkboxes
91081
- *
91082
- * The issue is `remark-gfm` does not actually classify these as task items when they have no content
91083
- * after the checkbox, which leaves them as plain text (`"[ ]"`). So a custom extension is needed to
91084
- * treat these as task items
91147
+ * Finds opening emphasis marker in a text value.
91148
+ * Returns marker info if found, null otherwise.
91085
91149
  */
91086
- function exitListItemWithEmptyTaskListItem(token) {
91087
- const node = this.stack[this.stack.length - 1];
91088
- if (node &&
91089
- node.type === 'listItem' &&
91090
- typeof node.checked !== 'boolean') {
91091
- const listItem = node;
91092
- const head = listItem.children[0];
91093
- if (head && head.type === 'paragraph' && head.children.length === 1) {
91094
- const text = head.children[0];
91095
- if (text.type === 'text') {
91096
- const hasTrailingWhitespace = typeof head.position?.end.offset === 'number' &&
91097
- typeof text.position?.end.offset === 'number' &&
91098
- head.position.end.offset > text.position.end.offset;
91099
- if (!hasTrailingWhitespace) {
91100
- this.exit(token);
91101
- return;
91102
- }
91103
- const value = text.value;
91104
- if (value === '[ ]') {
91105
- listItem.checked = false;
91106
- head.children = [];
91107
- }
91108
- else if (value === '[x]' || value === '[X]') {
91109
- listItem.checked = true;
91110
- head.children = [];
91111
- }
91150
+ function findOpeningMarker(text) {
91151
+ const results = MARKER_PATTERNS.map(({ isBold, marker }) => {
91152
+ if (marker === '*' && text.startsWith('**'))
91153
+ return null;
91154
+ if (marker === '_' && text.startsWith('__'))
91155
+ return null;
91156
+ if (text.startsWith(marker) && text.length > marker.length) {
91157
+ return { isBold, marker, textAfter: text.slice(marker.length), textBefore: '' };
91158
+ }
91159
+ const idx = text.indexOf(marker);
91160
+ if (idx > 0 && !/\s/.test(text[idx - 1])) {
91161
+ if (marker === '*' && text.slice(idx).startsWith('**'))
91162
+ return null;
91163
+ if (marker === '_' && text.slice(idx).startsWith('__'))
91164
+ return null;
91165
+ const after = text.slice(idx + marker.length);
91166
+ if (after.length > 0) {
91167
+ return { isBold, marker, textAfter: after, textBefore: text.slice(0, idx) };
91112
91168
  }
91113
91169
  }
91114
- }
91115
- this.exit(token);
91116
- }
91117
- function emptyTaskListItemFromMarkdown() {
91118
- return {
91119
- exit: {
91120
- listItem: exitListItemWithEmptyTaskListItem,
91121
- },
91122
- };
91170
+ return null;
91171
+ });
91172
+ return results.find(r => r !== null) ?? null;
91123
91173
  }
91124
-
91125
- ;// ./lib/mdast-util/legacy-variable/index.ts
91126
-
91127
- const contextMap = new WeakMap();
91128
- function findlegacyVariableToken() {
91129
- // tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
91130
- const events = this.tokenStack;
91131
- for (let i = events.length - 1; i >= 0; i -= 1) {
91132
- const token = events[i][0];
91133
- if (token.type === 'legacyVariable')
91134
- return token;
91174
+ /**
91175
+ * Finds the end/closing marker in a text node for multi-node emphasis.
91176
+ */
91177
+ function findEndMarker(text, marker) {
91178
+ const spacePattern = ` ${marker}`;
91179
+ const spaceIdx = text.indexOf(spacePattern);
91180
+ if (spaceIdx >= 0) {
91181
+ if (marker === '*' && text.slice(spaceIdx + 1).startsWith('**'))
91182
+ return null;
91183
+ if (marker === '_' && text.slice(spaceIdx + 1).startsWith('__'))
91184
+ return null;
91185
+ return {
91186
+ textAfter: text.slice(spaceIdx + spacePattern.length),
91187
+ textBefore: text.slice(0, spaceIdx),
91188
+ };
91135
91189
  }
91136
- return undefined;
91137
- }
91138
- function enterlegacyVariable(token) {
91139
- contextMap.set(token, { value: '' });
91140
- }
91141
- function exitlegacyVariableValue(token) {
91142
- const variableToken = findlegacyVariableToken.call(this);
91143
- if (!variableToken)
91144
- return;
91145
- const ctx = contextMap.get(variableToken);
91146
- // Build up the variable characters
91147
- if (ctx)
91148
- ctx.value += this.sliceSerialize(token);
91149
- }
91150
- function exitlegacyVariable(token) {
91151
- const ctx = contextMap.get(token);
91152
- const serialized = this.sliceSerialize(token);
91153
- const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
91154
- ? serialized.slice(2, -2)
91155
- : ctx?.value ?? '';
91156
- const nodePosition = {
91157
- start: {
91158
- offset: token.start.offset,
91159
- line: token.start.line,
91160
- column: token.start.column,
91161
- },
91162
- end: {
91163
- offset: token.end.offset,
91164
- line: token.end.line,
91165
- column: token.end.column,
91166
- },
91167
- };
91168
- if (variableName.startsWith('glossary:')) {
91169
- const term = variableName.slice('glossary:'.length).trim();
91170
- this.enter({
91171
- type: NodeTypes.glossary,
91172
- data: {
91173
- hName: 'Glossary',
91174
- hProperties: { term },
91175
- },
91176
- children: [{ type: 'text', value: term }],
91177
- position: nodePosition,
91178
- }, token);
91179
- this.exit(token);
91180
- contextMap.delete(token);
91181
- return;
91190
+ if (text.startsWith(marker)) {
91191
+ if (marker === '*' && text.startsWith('**'))
91192
+ return null;
91193
+ if (marker === '_' && text.startsWith('__'))
91194
+ return null;
91195
+ return {
91196
+ textAfter: text.slice(marker.length),
91197
+ textBefore: '',
91198
+ };
91182
91199
  }
91183
- this.enter({
91184
- type: NodeTypes.variable,
91185
- data: {
91186
- hName: 'Variable',
91187
- hProperties: { name: variableName.trim(), isLegacy: true },
91188
- },
91189
- value: `<<${variableName}>>`,
91190
- }, token);
91191
- this.exit(token);
91192
- contextMap.delete(token);
91193
- }
91194
- function legacyVariableFromMarkdown() {
91195
- return {
91196
- enter: {
91197
- legacyVariable: enterlegacyVariable,
91198
- },
91199
- exit: {
91200
- legacyVariableValue: exitlegacyVariableValue,
91201
- legacyVariable: exitlegacyVariable,
91202
- },
91203
- };
91200
+ return null;
91204
91201
  }
91205
-
91206
- ;// ./node_modules/micromark-util-symbol/lib/codes.js
91207
91202
  /**
91208
- * Character codes.
91209
- *
91210
- * This module is compiled away!
91211
- *
91212
- * micromark works based on character codes.
91213
- * This module contains constants for the ASCII block and the replacement
91214
- * character.
91215
- * A couple of them are handled in a special way, such as the line endings
91216
- * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
91217
- * tab) and its expansion based on what column it’s at (virtual space),
91218
- * and the end-of-file (eof) character.
91219
- * As values are preprocessed before handling them, the actual characters LF,
91220
- * CR, HT, and NUL (which is present as the replacement character), are
91221
- * guaranteed to not exist.
91222
- *
91223
- * Unicode basic latin block.
91203
+ * Scan children for an opening emphasis marker in a text node.
91224
91204
  */
91225
- const codes = /** @type {const} */ ({
91226
- carriageReturn: -5,
91227
- lineFeed: -4,
91228
- carriageReturnLineFeed: -3,
91229
- horizontalTab: -2,
91230
- virtualSpace: -1,
91231
- eof: null,
91232
- nul: 0,
91233
- soh: 1,
91234
- stx: 2,
91235
- etx: 3,
91236
- eot: 4,
91237
- enq: 5,
91238
- ack: 6,
91239
- bel: 7,
91240
- bs: 8,
91241
- ht: 9, // `\t`
91242
- lf: 10, // `\n`
91243
- vt: 11, // `\v`
91244
- ff: 12, // `\f`
91245
- cr: 13, // `\r`
91246
- so: 14,
91247
- si: 15,
91248
- dle: 16,
91249
- dc1: 17,
91250
- dc2: 18,
91251
- dc3: 19,
91252
- dc4: 20,
91253
- nak: 21,
91254
- syn: 22,
91255
- etb: 23,
91256
- can: 24,
91257
- em: 25,
91258
- sub: 26,
91259
- esc: 27,
91260
- fs: 28,
91261
- gs: 29,
91262
- rs: 30,
91263
- us: 31,
91264
- space: 32,
91265
- exclamationMark: 33, // `!`
91266
- quotationMark: 34, // `"`
91267
- numberSign: 35, // `#`
91268
- dollarSign: 36, // `$`
91269
- percentSign: 37, // `%`
91270
- ampersand: 38, // `&`
91271
- apostrophe: 39, // `'`
91272
- leftParenthesis: 40, // `(`
91273
- rightParenthesis: 41, // `)`
91274
- asterisk: 42, // `*`
91275
- plusSign: 43, // `+`
91276
- comma: 44, // `,`
91277
- dash: 45, // `-`
91278
- dot: 46, // `.`
91279
- slash: 47, // `/`
91280
- digit0: 48, // `0`
91281
- digit1: 49, // `1`
91282
- digit2: 50, // `2`
91283
- digit3: 51, // `3`
91284
- digit4: 52, // `4`
91285
- digit5: 53, // `5`
91286
- digit6: 54, // `6`
91287
- digit7: 55, // `7`
91288
- digit8: 56, // `8`
91289
- digit9: 57, // `9`
91290
- colon: 58, // `:`
91291
- semicolon: 59, // `;`
91292
- lessThan: 60, // `<`
91293
- equalsTo: 61, // `=`
91294
- greaterThan: 62, // `>`
91295
- questionMark: 63, // `?`
91296
- atSign: 64, // `@`
91297
- uppercaseA: 65, // `A`
91298
- uppercaseB: 66, // `B`
91299
- uppercaseC: 67, // `C`
91300
- uppercaseD: 68, // `D`
91301
- uppercaseE: 69, // `E`
91302
- uppercaseF: 70, // `F`
91303
- uppercaseG: 71, // `G`
91304
- uppercaseH: 72, // `H`
91305
- uppercaseI: 73, // `I`
91306
- uppercaseJ: 74, // `J`
91307
- uppercaseK: 75, // `K`
91308
- uppercaseL: 76, // `L`
91309
- uppercaseM: 77, // `M`
91310
- uppercaseN: 78, // `N`
91311
- uppercaseO: 79, // `O`
91312
- uppercaseP: 80, // `P`
91313
- uppercaseQ: 81, // `Q`
91314
- uppercaseR: 82, // `R`
91315
- uppercaseS: 83, // `S`
91316
- uppercaseT: 84, // `T`
91317
- uppercaseU: 85, // `U`
91318
- uppercaseV: 86, // `V`
91319
- uppercaseW: 87, // `W`
91320
- uppercaseX: 88, // `X`
91321
- uppercaseY: 89, // `Y`
91322
- uppercaseZ: 90, // `Z`
91323
- leftSquareBracket: 91, // `[`
91324
- backslash: 92, // `\`
91325
- rightSquareBracket: 93, // `]`
91326
- caret: 94, // `^`
91327
- underscore: 95, // `_`
91328
- graveAccent: 96, // `` ` ``
91329
- lowercaseA: 97, // `a`
91330
- lowercaseB: 98, // `b`
91331
- lowercaseC: 99, // `c`
91332
- lowercaseD: 100, // `d`
91333
- lowercaseE: 101, // `e`
91334
- lowercaseF: 102, // `f`
91335
- lowercaseG: 103, // `g`
91336
- lowercaseH: 104, // `h`
91337
- lowercaseI: 105, // `i`
91338
- lowercaseJ: 106, // `j`
91339
- lowercaseK: 107, // `k`
91340
- lowercaseL: 108, // `l`
91341
- lowercaseM: 109, // `m`
91342
- lowercaseN: 110, // `n`
91343
- lowercaseO: 111, // `o`
91344
- lowercaseP: 112, // `p`
91345
- lowercaseQ: 113, // `q`
91346
- lowercaseR: 114, // `r`
91347
- lowercaseS: 115, // `s`
91348
- lowercaseT: 116, // `t`
91349
- lowercaseU: 117, // `u`
91350
- lowercaseV: 118, // `v`
91351
- lowercaseW: 119, // `w`
91352
- lowercaseX: 120, // `x`
91353
- lowercaseY: 121, // `y`
91354
- lowercaseZ: 122, // `z`
91355
- leftCurlyBrace: 123, // `{`
91356
- verticalBar: 124, // `|`
91357
- rightCurlyBrace: 125, // `}`
91358
- tilde: 126, // `~`
91359
- del: 127,
91360
- // Unicode Specials block.
91361
- byteOrderMarker: 65_279,
91362
- // Unicode Specials block.
91363
- replacementCharacter: 65_533 // `�`
91364
- })
91365
-
91366
- ;// ./lib/micromark/legacy-variable/syntax.ts
91367
-
91368
-
91369
- function isAllowedValueChar(code) {
91370
- return (code !== null &&
91371
- code !== codes.lessThan &&
91372
- code !== codes.greaterThan &&
91373
- !markdownLineEnding(code));
91374
- }
91375
- const legacyVariableConstruct = {
91376
- name: 'legacyVariable',
91377
- tokenize,
91378
- };
91379
- function tokenize(effects, ok, nok) {
91380
- let hasValue = false;
91381
- const start = (code) => {
91382
- if (code !== codes.lessThan)
91383
- return nok(code);
91384
- effects.enter('legacyVariable');
91385
- effects.enter('legacyVariableMarkerStart');
91386
- effects.consume(code); // <
91387
- return open2;
91388
- };
91389
- const open2 = (code) => {
91390
- if (code !== codes.lessThan)
91391
- return nok(code);
91392
- effects.consume(code); // <<
91393
- effects.exit('legacyVariableMarkerStart');
91394
- effects.enter('legacyVariableValue');
91395
- return value;
91396
- };
91397
- const value = (code) => {
91398
- if (code === codes.greaterThan) {
91399
- if (!hasValue)
91400
- return nok(code);
91401
- effects.exit('legacyVariableValue');
91402
- effects.enter('legacyVariableMarkerEnd');
91403
- effects.consume(code); // >
91404
- return close2;
91205
+ function findOpeningInChildren(children) {
91206
+ let result = null;
91207
+ children.some((child, idx) => {
91208
+ if (child.type !== 'text')
91209
+ return false;
91210
+ const found = findOpeningMarker(child.value);
91211
+ if (found) {
91212
+ result = { idx, opening: found };
91213
+ return true;
91405
91214
  }
91406
- if (!isAllowedValueChar(code))
91407
- return nok(code);
91408
- hasValue = true;
91409
- effects.consume(code);
91410
- return value;
91411
- };
91412
- const close2 = (code) => {
91413
- if (code !== codes.greaterThan)
91414
- return nok(code);
91415
- effects.consume(code); // >>
91416
- effects.exit('legacyVariableMarkerEnd');
91417
- effects.exit('legacyVariable');
91418
- return ok;
91419
- };
91420
- return start;
91215
+ return false;
91216
+ });
91217
+ return result;
91421
91218
  }
91422
- function legacyVariable() {
91423
- return {
91424
- text: { [codes.lessThan]: legacyVariableConstruct },
91425
- };
91219
+ /**
91220
+ * Scan children (after openingIdx) for a closing emphasis marker.
91221
+ */
91222
+ function findClosingInChildren(children, openingIdx, marker) {
91223
+ let result = null;
91224
+ children.slice(openingIdx + 1).some((child, relativeIdx) => {
91225
+ if (child.type !== 'text')
91226
+ return false;
91227
+ const found = findEndMarker(child.value, marker);
91228
+ if (found) {
91229
+ result = { closingIdx: openingIdx + 1 + relativeIdx, closing: found };
91230
+ return true;
91231
+ }
91232
+ return false;
91233
+ });
91234
+ return result;
91426
91235
  }
91427
-
91428
- ;// ./lib/micromark/legacy-variable/index.ts
91429
91236
  /**
91430
- * Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
91237
+ * Build the replacement nodes for a matched emphasis pair.
91431
91238
  */
91432
-
91433
-
91434
- ;// ./processor/transform/mdxish/constants.ts
91239
+ function buildReplacementNodes(container, { opening, openingIdx, closing, closingIdx }) {
91240
+ const newNodes = [];
91241
+ if (opening.textBefore) {
91242
+ newNodes.push({ type: 'text', value: `${opening.textBefore} ` });
91243
+ }
91244
+ const emphasisChildren = [];
91245
+ const openingText = opening.textAfter.replace(/^\s+/, '');
91246
+ if (openingText) {
91247
+ emphasisChildren.push({ type: 'text', value: openingText });
91248
+ }
91249
+ container.children.slice(openingIdx + 1, closingIdx).forEach(child => {
91250
+ emphasisChildren.push(child);
91251
+ });
91252
+ const closingText = closing.textBefore.replace(/\s+$/, '');
91253
+ if (closingText) {
91254
+ emphasisChildren.push({ type: 'text', value: closingText });
91255
+ }
91256
+ if (emphasisChildren.length > 0) {
91257
+ const emphasisNode = opening.isBold
91258
+ ? { type: 'strong', children: emphasisChildren }
91259
+ : { type: 'emphasis', children: emphasisChildren };
91260
+ newNodes.push(emphasisNode);
91261
+ }
91262
+ if (closing.textAfter) {
91263
+ newNodes.push({ type: 'text', value: closing.textAfter });
91264
+ }
91265
+ return newNodes;
91266
+ }
91435
91267
  /**
91436
- * Inline component tags handled by mdxish-inline-components.ts.
91437
- * Also excluded from block-level handling in mdxish-component-blocks.ts.
91268
+ * Find and transform one multi-node emphasis pair in the container.
91269
+ * Returns true if a pair was found and transformed, false otherwise.
91438
91270
  */
91439
- const INLINE_COMPONENT_TAGS = new Set(['Anchor']);
91440
-
91441
- ;// ./processor/transform/mdxish/mdxish-component-blocks.ts
91442
-
91443
-
91444
-
91445
-
91446
-
91447
-
91448
-
91449
- const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
91450
- const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
91451
- /**
91452
- * Maximum number of siblings to scan forward when looking for a closing tag
91453
- * to avoid scanning too far and degrading performance
91454
- */
91455
- const MAX_LOOKAHEAD = 30;
91456
- /**
91457
- * Tags that have dedicated transformers and should NOT be handled by this plugin.
91458
- * These components either have special parsing requirements that the generic component
91459
- * block transformer cannot handle correctly, or are inline components that we don't
91460
- * want to convert to mdxJsxFlowElement which is a block level element.
91461
- */
91462
- const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', ...INLINE_COMPONENT_TAGS]);
91463
- const inlineMdProcessor = unified()
91464
- .data('micromarkExtensions', [legacyVariable()])
91465
- .data('fromMarkdownExtensions', [legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown()])
91466
- .use(remarkParse)
91467
- .use(remarkGfm);
91468
- const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
91469
- /**
91470
- * Parse markdown content into mdast children nodes.
91471
- */
91472
- const parseMdChildren = (value) => {
91473
- const parsed = inlineMdProcessor.parse(value);
91474
- return parsed.children || [];
91475
- };
91476
- /**
91477
- * Convert raw attribute string into mdxJsxAttribute entries.
91478
- * Handles both key-value attributes (theme="info") and boolean attributes (empty).
91479
- */
91480
- const parseAttributes = (raw) => {
91481
- const attributes = [];
91482
- const attrString = raw.trim();
91483
- if (!attrString)
91484
- return attributes;
91485
- tagAttributePattern.lastIndex = 0;
91486
- let match = tagAttributePattern.exec(attrString);
91487
- while (match !== null) {
91488
- const [, attrName, attrValue] = match;
91489
- const value = attrValue ? attrValue.replace(/^['"]|['"]$/g, '') : null;
91490
- attributes.push({ type: 'mdxJsxAttribute', name: attrName, value });
91491
- match = tagAttributePattern.exec(attrString);
91492
- }
91493
- return attributes;
91494
- };
91495
- /**
91496
- * Parse an HTML tag string into structured data.
91497
- */
91498
- const parseTag = (value) => {
91499
- const match = value.match(pascalCaseTagPattern);
91500
- if (!match)
91501
- return null;
91502
- const [, tag, attrString = '', selfClosing = '', contentAfterTag = ''] = match;
91503
- return {
91504
- tag,
91505
- attributes: parseAttributes(attrString),
91506
- selfClosing: !!selfClosing,
91507
- contentAfterTag,
91508
- };
91509
- };
91510
- /**
91511
- * Parse substring content of a node and update the parent's children to include the new nodes.
91512
- */
91513
- const parseSibling = (stack, parent, index, sibling) => {
91514
- const siblingNodes = parseMdChildren(sibling);
91515
- // The new sibling nodes might contain new components to be processed
91516
- if (siblingNodes.length > 0) {
91517
- parent.children.splice(index + 1, 0, ...siblingNodes);
91518
- stack.push(parent);
91519
- }
91520
- };
91521
- /**
91522
- * Create an MdxJsxFlowElement node from component data.
91523
- */
91524
- const createComponentNode = ({ tag, attributes, children, startPosition, endPosition }) => ({
91525
- type: 'mdxJsxFlowElement',
91526
- name: tag,
91527
- attributes,
91528
- children,
91529
- position: {
91530
- start: startPosition?.start,
91531
- end: endPosition?.end ?? startPosition?.end,
91532
- },
91533
- });
91534
- /**
91535
- * Remove a closing tag from a paragraph's children and return the updated paragraph.
91536
- */
91537
- const stripClosingTagFromParagraph = (node, tag) => {
91538
- if (!Array.isArray(node.children))
91539
- return { paragraph: node, found: false };
91540
- const children = [...node.children];
91541
- const closingIndex = children.findIndex(child => child.type === 'html' && isClosingTag(child.value || '', tag));
91542
- if (closingIndex === -1)
91543
- return { paragraph: node, found: false };
91544
- children.splice(closingIndex, 1);
91545
- return { paragraph: { ...node, children }, found: true };
91546
- };
91271
+ function processOneEmphasisPair(container) {
91272
+ const openingResult = findOpeningInChildren(container.children);
91273
+ if (!openingResult)
91274
+ return false;
91275
+ const { idx: openingIdx, opening } = openingResult;
91276
+ const closingResult = findClosingInChildren(container.children, openingIdx, opening.marker);
91277
+ if (!closingResult)
91278
+ return false;
91279
+ const { closingIdx, closing } = closingResult;
91280
+ const newNodes = buildReplacementNodes(container, { opening, openingIdx, closing, closingIdx });
91281
+ const deleteCount = closingIdx - openingIdx + 1;
91282
+ container.children.splice(openingIdx, deleteCount, ...newNodes);
91283
+ return true;
91284
+ }
91547
91285
  /**
91548
- * Scan forward through siblings to find a closing tag.
91549
- * Handles:
91550
- * - Exact match HTML siblings (e.g., `</Tag>`)
91551
- * - HTML siblings with embedded closing tag (e.g., `...\n</Tag>`)
91552
- * - Paragraph siblings containing the closing tag as a child
91553
- *
91554
- * Returns null if not found within MAX_LOOKAHEAD siblings
91286
+ * Handle malformed emphasis that spans multiple AST nodes.
91287
+ * E.g., "**bold [link](url)**" where markers are in different text nodes.
91555
91288
  */
91556
- const scanForClosingTag = (parent, startIndex, tag) => {
91557
- const closingTagStr = `</${tag}>`;
91558
- const maxIndex = Math.min(startIndex + MAX_LOOKAHEAD, parent.children.length);
91559
- let i = startIndex + 1;
91560
- for (; i < maxIndex; i += 1) {
91561
- const sibling = parent.children[i];
91562
- // Check HTML siblings
91563
- if (sibling.type === 'html') {
91564
- const siblingValue = sibling.value || '';
91565
- // Exact match (standalone closing tag)
91566
- if (isClosingTag(siblingValue, tag)) {
91567
- return { closingIndex: i, extraClosingChildren: [] };
91568
- }
91569
- // Embedded closing tag (closing tag within HTML block content)
91570
- if (siblingValue.includes(closingTagStr)) {
91571
- const closeTagPos = siblingValue.indexOf(closingTagStr);
91572
- const contentBeforeClose = siblingValue.substring(0, closeTagPos).trim();
91573
- const contentAfterClose = siblingValue.substring(closeTagPos + closingTagStr.length).trim();
91574
- const extraChildren = contentBeforeClose
91575
- ? parseMdChildren(contentBeforeClose)
91576
- : [];
91577
- return { closingIndex: i, extraClosingChildren: extraChildren, contentAfterClose: contentAfterClose || undefined };
91578
- }
91579
- }
91580
- // Check paragraph siblings
91581
- if (sibling.type === 'paragraph') {
91582
- const { paragraph, found } = stripClosingTagFromParagraph(sibling, tag);
91583
- if (found) {
91584
- return { closingIndex: i, extraClosingChildren: [], strippedParagraph: paragraph };
91585
- }
91289
+ function visitMultiNodeEmphasis(tree) {
91290
+ const containerTypes = ['paragraph', 'heading', 'tableCell', 'listItem', 'blockquote'];
91291
+ visit(tree, node => {
91292
+ if (!containerTypes.includes(node.type))
91293
+ return;
91294
+ if (!('children' in node) || !Array.isArray(node.children))
91295
+ return;
91296
+ const container = node;
91297
+ let foundPair = true;
91298
+ while (foundPair) {
91299
+ foundPair = processOneEmphasisPair(container);
91586
91300
  }
91587
- }
91588
- if (i < parent.children.length) {
91589
- // eslint-disable-next-line no-console
91590
- console.warn(`Closing tag </${tag}> not found within ${MAX_LOOKAHEAD} siblings, stopping scan`);
91591
- }
91592
- return null;
91593
- };
91594
- const substituteNodeWithMdxNode = (parent, index, mdxNode) => {
91595
- parent.children.splice(index, 1, mdxNode);
91596
- };
91301
+ });
91302
+ }
91597
91303
  /**
91598
- * Transform PascalCase HTML nodes into mdxJsxFlowElement nodes.
91599
- *
91600
- * Remark parses unknown/custom component tags as raw HTML nodes.
91601
- * These are the custom readme MDX syntax for components.
91602
- * This transformer identifies these patterns and converts them to proper MDX JSX elements so they
91603
- * can be accurately recognized and rendered later with their component definition code.
91604
- * Though for some tags, we need to handle them specially
91605
- *
91606
- * ## Supported HTML Structures
91607
- *
91608
- * ### 1. Self-closing tags
91609
- * ```
91610
- * <Component />
91611
- * ```
91612
- * Parsed as: `html: "<Component />"`
91613
- *
91614
- * ### 2. Self-contained blocks (entire component in single HTML node)
91615
- * ```
91616
- * <Button>Click me</Button>
91617
- * ```
91618
- * ```
91619
- * <Component>
91620
- * <h2>Title</h2>
91621
- * <p>Content</p>
91622
- * </Component>
91623
- * ```
91624
- * Parsed as: `html: "<Component>\n <h2>Title</h2>\n <p>Content</p>\n</Component>"`
91625
- * The opening tag, content, and closing tag are all captured in one HTML node.
91626
- *
91627
- * ### 3. Multi-sibling components (closing tag in a following sibling)
91628
- * Handles various structures where the closing tag is in a later sibling, such as:
91629
- *
91630
- * #### 3a. Block components (closing tag in sibling paragraph)
91631
- * ```
91632
- * <Callout>
91633
- * Some **markdown** content
91634
- * </Callout>
91635
- * ```
91636
- *
91637
- * #### 3b. Multi-paragraph components (closing tag several siblings away)
91638
- * ```
91639
- * <Callout>
91640
- *
91641
- * First paragraph
91642
- *
91643
- * Second paragraph
91644
- * </Callout>
91645
- * ```
91304
+ * A remark plugin that normalizes malformed bold and italic markers in text nodes.
91305
+ * Detects patterns like `** bold**`, `Hello** Wrong Bold**`, `__ bold__`, `Hello__ Wrong Bold__`,
91306
+ * `* italic*`, `Hello* Wrong Italic*`, `_ italic_`, or `Hello_ Wrong Italic_`
91307
+ * and converts them to proper strong/emphasis nodes, matching the behavior of the legacy rdmd engine.
91646
91308
  *
91647
- * #### 3c. Nested components split by blank lines (closing tag embedded in HTML sibling)
91648
- * ```
91649
- * <Outer>
91650
- * <Inner>content</Inner>
91309
+ * Supports both asterisk (`**bold**`, `*italic*`) and underscore (`__bold__`, `_italic_`) syntax.
91310
+ * Also supports snake_case content like `** some_snake_case**`.
91651
91311
  *
91652
- * <Inner>content</Inner>
91653
- * </Outer>
91654
- * ```
91312
+ * This runs after remark-parse, which (in v11+) is strict and doesn't parse
91313
+ * malformed emphasis syntax. This plugin post-processes the AST to handle these cases.
91655
91314
  */
91656
- const mdxishComponentBlocks = () => tree => {
91657
- const stack = [tree];
91658
- const processChildNode = (parent, index) => {
91659
- const node = parent.children[index];
91660
- if (!node)
91661
- return;
91662
- if ('children' in node && Array.isArray(node.children)) {
91663
- stack.push(node);
91315
+ const normalizeEmphasisAST = () => (tree) => {
91316
+ visit(tree, 'text', function visitor(node, index, parent) {
91317
+ if (index === undefined || !parent)
91318
+ return undefined;
91319
+ // Skip if inside code blocks or inline code
91320
+ if (parent.type === 'inlineCode' || parent.type === 'code') {
91321
+ return undefined;
91664
91322
  }
91665
- // Only visit HTML nodes with an actual html tag,
91666
- // which means a potential unparsed MDX component
91667
- const value = node.value;
91668
- if (node.type !== 'html' || typeof value !== 'string')
91669
- return;
91670
- const parsed = parseTag(value.trim());
91671
- if (!parsed)
91672
- return;
91673
- const { tag, attributes, selfClosing, contentAfterTag = '' } = parsed;
91674
- // Skip tags that have dedicated transformers
91675
- if (EXCLUDED_TAGS.has(tag))
91676
- return;
91677
- const closingTagStr = `</${tag}>`;
91678
- // Case 1: Self-closing tag
91679
- if (selfClosing) {
91680
- const componentNode = createComponentNode({
91681
- tag,
91682
- attributes,
91683
- children: [],
91684
- startPosition: node.position,
91685
- });
91686
- substituteNodeWithMdxNode(parent, index, componentNode);
91687
- // Check and parse if there's relevant content after the current closing tag
91688
- const remainingContent = contentAfterTag.trim();
91689
- if (remainingContent) {
91690
- parseSibling(stack, parent, index, remainingContent);
91323
+ const text = node.value;
91324
+ const allMatches = [];
91325
+ [...text.matchAll(asteriskBoldRegex)].forEach(match => {
91326
+ allMatches.push({ isBold: true, marker: '**', match });
91327
+ });
91328
+ [...text.matchAll(underscoreBoldRegex)].forEach(match => {
91329
+ allMatches.push({ isBold: true, marker: '__', match });
91330
+ });
91331
+ [...text.matchAll(asteriskItalicRegex)].forEach(match => {
91332
+ allMatches.push({ isBold: false, marker: '*', match });
91333
+ });
91334
+ [...text.matchAll(underscoreItalicRegex)].forEach(match => {
91335
+ allMatches.push({ isBold: false, marker: '_', match });
91336
+ });
91337
+ [...text.matchAll(intrawordUnderscoreItalicRegex)].forEach(match => {
91338
+ allMatches.push({ isBold: false, isIntraword: true, marker: '_', match });
91339
+ });
91340
+ [...text.matchAll(intrawordUnderscoreBoldRegex)].forEach(match => {
91341
+ allMatches.push({ isBold: true, isIntraword: true, marker: '__', match });
91342
+ });
91343
+ [...text.matchAll(intrawordAsteriskItalicRegex)].forEach(match => {
91344
+ allMatches.push({ isBold: false, isIntraword: true, marker: '*', match });
91345
+ });
91346
+ [...text.matchAll(intrawordAsteriskBoldRegex)].forEach(match => {
91347
+ allMatches.push({ isBold: true, isIntraword: true, marker: '**', match });
91348
+ });
91349
+ if (allMatches.length === 0)
91350
+ return undefined;
91351
+ allMatches.sort((a, b) => (a.match.index ?? 0) - (b.match.index ?? 0));
91352
+ const filteredMatches = [];
91353
+ let lastEnd = 0;
91354
+ allMatches.forEach(info => {
91355
+ const start = info.match.index ?? 0;
91356
+ const end = start + info.match[0].length;
91357
+ if (start >= lastEnd) {
91358
+ filteredMatches.push(info);
91359
+ lastEnd = end;
91691
91360
  }
91692
- return;
91693
- }
91694
- // Case 2: Self-contained block (closing tag in content)
91695
- if (contentAfterTag.includes(closingTagStr)) {
91696
- // Find the first closing tag
91697
- const closingTagIndex = contentAfterTag.indexOf(closingTagStr);
91698
- const componentInnerContent = contentAfterTag.substring(0, closingTagIndex).trim();
91699
- const contentAfterClose = contentAfterTag.substring(closingTagIndex + closingTagStr.length).trim();
91700
- const componentNode = createComponentNode({
91701
- tag,
91702
- attributes,
91703
- children: componentInnerContent ? parseMdChildren(componentInnerContent) : [],
91704
- startPosition: node.position,
91705
- });
91706
- substituteNodeWithMdxNode(parent, index, componentNode);
91707
- // After the closing tag, there might be more content to be processed
91708
- if (contentAfterClose) {
91709
- parseSibling(stack, parent, index, contentAfterClose);
91361
+ });
91362
+ if (filteredMatches.length === 0)
91363
+ return undefined;
91364
+ const parts = [];
91365
+ let lastIndex = 0;
91366
+ filteredMatches.forEach(({ isBold, isIntraword, marker, match }) => {
91367
+ const matchIndex = match.index ?? 0;
91368
+ const fullMatch = match[0];
91369
+ if (isIntraword) {
91370
+ // handles cases like hello_world_ where we only want to italicize 'world'
91371
+ const charBefore = match[1] || ''; // e.g., "l" in "hello_world_"
91372
+ const content = match[2]; // e.g., "world"
91373
+ const combinedBefore = text.slice(lastIndex, matchIndex) + charBefore;
91374
+ if (combinedBefore) {
91375
+ parts.push({ type: 'text', value: combinedBefore });
91376
+ }
91377
+ if (isBold) {
91378
+ parts.push({
91379
+ type: 'strong',
91380
+ children: [{ type: 'text', value: content }],
91381
+ });
91382
+ }
91383
+ else {
91384
+ parts.push({
91385
+ type: 'emphasis',
91386
+ children: [{ type: 'text', value: content }],
91387
+ });
91388
+ }
91389
+ lastIndex = matchIndex + fullMatch.length;
91390
+ return;
91710
91391
  }
91711
- else if (componentNode.children.length > 0) {
91712
- // The content inside the component block might contain new components to be processed
91713
- stack.push(componentNode);
91392
+ if (matchIndex > lastIndex) {
91393
+ const beforeText = text.slice(lastIndex, matchIndex);
91394
+ if (beforeText) {
91395
+ parts.push({ type: 'text', value: beforeText });
91396
+ }
91714
91397
  }
91715
- return;
91716
- }
91717
- // Case 3: Multi-sibling component (closing tag in a following sibling)
91718
- // Scans forward through siblings to find closing tag in HTML or paragraph nodes
91719
- const scanResult = scanForClosingTag(parent, index, tag);
91720
- if (!scanResult)
91721
- return;
91722
- const { closingIndex, extraClosingChildren, strippedParagraph, contentAfterClose: remainingAfterClose } = scanResult;
91723
- const extraChildren = contentAfterTag ? parseMdChildren(contentAfterTag.trimStart()) : [];
91724
- // Collect all intermediate siblings between opening tag and closing tag
91725
- const intermediateChildren = parent.children.slice(index + 1, closingIndex);
91726
- // For paragraph siblings, include the full paragraph (with closing tag stripped)
91727
- // For HTML siblings, include any content parsed from before the closing tag
91728
- const closingChildren = strippedParagraph
91729
- ? (strippedParagraph.children.length > 0 ? [strippedParagraph] : [])
91730
- : extraClosingChildren;
91731
- const componentNode = createComponentNode({
91732
- tag,
91733
- attributes,
91734
- children: [...extraChildren, ...intermediateChildren, ...closingChildren],
91735
- startPosition: node.position,
91736
- endPosition: parent.children[closingIndex]?.position,
91398
+ const wordBefore = match[1]; // e.g., "Hello" in "Hello** Wrong Bold**"
91399
+ const contentWithSpaceAfter = match[3]; // Content when there's a space after opening markers
91400
+ const trailingSpace1 = match[4] || ''; // Space before closing markers (for "** text **" pattern)
91401
+ const contentWithSpaceBefore = match[5]; // Content when there's only a space before closing markers
91402
+ const trailingSpace2 = match[6] || ''; // Space before closing markers (for "**text **" pattern)
91403
+ const trailingSpace = trailingSpace1 || trailingSpace2; // Combined trailing space
91404
+ const content = (contentWithSpaceAfter || contentWithSpaceBefore || '').trim();
91405
+ const afterChar = match[7]; // Character after closing markers (if any)
91406
+ const markerPos = fullMatch.indexOf(marker);
91407
+ const spacesBeforeMarkers = wordBefore
91408
+ ? fullMatch.slice(wordBefore.length, markerPos)
91409
+ : fullMatch.slice(0, markerPos);
91410
+ const shouldAddSpace = !!contentWithSpaceAfter && !!wordBefore && !spacesBeforeMarkers;
91411
+ if (wordBefore) {
91412
+ const spacing = spacesBeforeMarkers + (shouldAddSpace ? ' ' : '');
91413
+ parts.push({ type: 'text', value: wordBefore + spacing });
91414
+ }
91415
+ else if (spacesBeforeMarkers) {
91416
+ parts.push({ type: 'text', value: spacesBeforeMarkers });
91417
+ }
91418
+ if (content) {
91419
+ if (isBold) {
91420
+ parts.push({
91421
+ type: 'strong',
91422
+ children: [{ type: 'text', value: content }],
91423
+ });
91424
+ }
91425
+ else {
91426
+ parts.push({
91427
+ type: 'emphasis',
91428
+ children: [{ type: 'text', value: content }],
91429
+ });
91430
+ }
91431
+ }
91432
+ if (afterChar) {
91433
+ const prefix = trailingSpace ? ' ' : '';
91434
+ parts.push({ type: 'text', value: prefix + afterChar });
91435
+ }
91436
+ lastIndex = matchIndex + fullMatch.length;
91737
91437
  });
91738
- // Remove all nodes from opening tag to closing tag (inclusive) and replace with component node
91739
- parent.children.splice(index, closingIndex - index + 1, componentNode);
91740
- // Since we might be merging sibling nodes together and combining content,
91741
- // there might be new components to process
91742
- if (componentNode.children.length > 0) {
91743
- stack.push(componentNode);
91744
- }
91745
- // If the closing tag sibling had content after it (e.g., another component opening tag),
91746
- // re-insert it as a sibling so it can be processed in subsequent iterations
91747
- if (remainingAfterClose) {
91748
- parseSibling(stack, parent, index, remainingAfterClose);
91438
+ if (lastIndex < text.length) {
91439
+ const remainingText = text.slice(lastIndex);
91440
+ if (remainingText) {
91441
+ parts.push({ type: 'text', value: remainingText });
91442
+ }
91749
91443
  }
91750
- };
91751
- // Process the nodes with the components depth-first to maintain the correct order of the nodes
91752
- while (stack.length) {
91753
- const parent = stack.pop();
91754
- if (parent?.children) {
91755
- parent.children.forEach((_child, index) => {
91756
- processChildNode(parent, index);
91757
- });
91444
+ if (parts.length > 0) {
91445
+ parent.children.splice(index, 1, ...parts);
91446
+ return [SKIP, index + parts.length];
91758
91447
  }
91759
- }
91448
+ return undefined;
91449
+ });
91450
+ // Handle malformed emphasis spanning multiple nodes (e.g., **text [link](url) **)
91451
+ visitMultiNodeEmphasis(tree);
91760
91452
  return tree;
91761
91453
  };
91762
- /* harmony default export */ const mdxish_component_blocks = (mdxishComponentBlocks);
91454
+ /* harmony default export */ const normalize_malformed_md_syntax = (normalizeEmphasisAST);
91763
91455
 
91764
91456
  ;// ./processor/transform/mdxish/mdxish-tables.ts
91765
91457
 
@@ -91770,14 +91462,21 @@ const mdxishComponentBlocks = () => tree => {
91770
91462
 
91771
91463
 
91772
91464
 
91465
+
91466
+
91467
+
91773
91468
  const isTableCell = (node) => isMDXElement(node) && ['th', 'td'].includes(node.name);
91774
91469
  const tableTypes = {
91775
91470
  tr: 'tableRow',
91776
91471
  th: 'tableCell',
91777
91472
  td: 'tableCell',
91778
91473
  };
91779
- const mdCellProcessor = unified().use(remarkParse).use(remarkGfm);
91780
- const tableNodeProcessor = unified().use(remarkParse).use(remarkMdx).use(mdxish_component_blocks);
91474
+ const tableNodeProcessor = unified()
91475
+ .use(remarkParse)
91476
+ .use(remarkMdx)
91477
+ .use(normalize_malformed_md_syntax)
91478
+ .use([callouts, gemoji_])
91479
+ .use(remarkGfm);
91781
91480
  /**
91782
91481
  * Check if children are only text nodes that might contain markdown
91783
91482
  */
@@ -91807,14 +91506,14 @@ const extractTextFromChildren = (children) => {
91807
91506
  .join('');
91808
91507
  };
91809
91508
  /**
91810
- * Parse markdown text into MDAST nodes
91509
+ * Returns true if any node in the array is block-level (non-phrasing) content.
91811
91510
  */
91812
- const parseMarkdown = (text) => {
91813
- const tree = mdCellProcessor.runSync(mdCellProcessor.parse(text));
91814
- return (tree.children || []);
91511
+ const hasFlowContent = (nodes) => {
91512
+ return nodes.some(node => !phrasing(node) && node.type !== 'paragraph');
91815
91513
  };
91816
91514
  /**
91817
- * Process a Table node (either MDX JSX element or parsed from HTML) and convert to markdown table
91515
+ * Process a Table node: re-parse text-only cell content, then output as
91516
+ * a markdown table (phrasing-only) or keep as JSX <Table> (has flow content).
91818
91517
  */
91819
91518
  const processTableNode = (node, index, parent) => {
91820
91519
  if (node.name !== 'Table')
@@ -91822,54 +91521,88 @@ const processTableNode = (node, index, parent) => {
91822
91521
  const { position } = node;
91823
91522
  const { align: alignAttr } = getAttrs(node);
91824
91523
  const align = Array.isArray(alignAttr) ? alignAttr : null;
91825
- const children = [];
91826
- // Process rows from thead and tbody
91827
- // The structure is: Table -> thead/tbody -> tr -> td/th
91828
- const processRow = (row) => {
91829
- const rowChildren = [];
91830
- visit(row, isTableCell, ({ name, children: cellChildren, position: cellPosition }) => {
91831
- let parsedChildren = cellChildren;
91832
- // If cell contains only text nodes, try to re-parse as markdown
91833
- if (isTextOnly(cellChildren)) {
91834
- const textContent = extractTextFromChildren(cellChildren);
91835
- if (textContent.trim()) {
91836
- try {
91837
- const parsed = parseMarkdown(textContent);
91838
- // If parsing produced nodes, use them; otherwise keep original
91839
- if (parsed.length > 0) {
91840
- // Flatten paragraphs if they contain only phrasing content
91841
- parsedChildren = parsed.flatMap(parsedNode => {
91842
- if (parsedNode.type === 'paragraph' && 'children' in parsedNode && parsedNode.children) {
91843
- return parsedNode.children;
91844
- }
91845
- return [parsedNode];
91846
- });
91847
- }
91848
- }
91849
- catch {
91850
- // If parsing fails, keep original children
91851
- }
91524
+ let tableHasFlowContent = false;
91525
+ // Re-parse text-only cells through markdown and detect flow content
91526
+ visit(node, isTableCell, (cell) => {
91527
+ if (!isTextOnly(cell.children))
91528
+ return;
91529
+ const textContent = extractTextFromChildren(cell.children);
91530
+ if (!textContent.trim())
91531
+ return;
91532
+ // Since now we are using remarkMdx, which can fail and error, we need to
91533
+ // gate this behind a try/catch to ensure that malformed syntaxes do not
91534
+ // crash the page
91535
+ try {
91536
+ const parsed = tableNodeProcessor.runSync(tableNodeProcessor.parse(textContent));
91537
+ if (parsed.children.length > 0) {
91538
+ cell.children = parsed.children;
91539
+ if (hasFlowContent(parsed.children)) {
91540
+ tableHasFlowContent = true;
91852
91541
  }
91853
91542
  }
91854
- rowChildren.push({
91855
- type: tableTypes[name],
91856
- children: parsedChildren,
91857
- position: cellPosition,
91858
- });
91859
- });
91860
- children.push({
91861
- type: tableTypes[row.name],
91862
- children: rowChildren,
91863
- position: row.position,
91543
+ }
91544
+ catch {
91545
+ // If parsing fails, keep original children
91546
+ }
91547
+ });
91548
+ // mdast's table node always treats the first tableRow as <thead>, so we can't
91549
+ // represent a header-less table in mdast without the first body row getting
91550
+ // promoted. Keep as JSX instead so remarkRehype renders it correctly
91551
+ let hasThead = false;
91552
+ visit(node, isMDXElement, (child) => {
91553
+ if (child.name === 'thead')
91554
+ hasThead = true;
91555
+ });
91556
+ if (tableHasFlowContent || !hasThead) {
91557
+ // remarkMdx wraps inline elements in paragraph nodes (e.g. <td> on the
91558
+ // same line as content becomes mdxJsxTextElement inside a paragraph).
91559
+ // Unwrap these so <td>/<th> sit directly under <tr>, and strip
91560
+ // whitespace-only text nodes to avoid rendering empty <p>/<br>.
91561
+ const cleanChildren = (children) => children
91562
+ .flatMap(child => {
91563
+ if (child.type === 'paragraph' && 'children' in child && Array.isArray(child.children)) {
91564
+ return child.children;
91565
+ }
91566
+ return [child];
91567
+ })
91568
+ .filter(child => !(child.type === 'text' && 'value' in child && typeof child.value === 'string' && !child.value.trim()));
91569
+ visit(node, isMDXElement, (el) => {
91570
+ if ('children' in el && Array.isArray(el.children)) {
91571
+ el.children = cleanChildren(el.children);
91572
+ }
91864
91573
  });
91865
- };
91866
- // Visit thead and tbody, then find tr elements within them
91574
+ parent.children[index] = {
91575
+ ...node,
91576
+ position,
91577
+ };
91578
+ return;
91579
+ }
91580
+ // All cells are phrasing-only — convert to markdown table
91581
+ const children = [];
91867
91582
  visit(node, isMDXElement, (child) => {
91868
91583
  if (child.name === 'thead' || child.name === 'tbody') {
91869
91584
  visit(child, isMDXElement, (row) => {
91870
- if (row.name === 'tr' && row.type === 'mdxJsxFlowElement') {
91871
- processRow(row);
91872
- }
91585
+ if (row.name !== 'tr')
91586
+ return;
91587
+ const rowChildren = [];
91588
+ visit(row, isTableCell, ({ name, children: cellChildren, position: cellPosition }) => {
91589
+ const parsedChildren = cellChildren.flatMap(parsedNode => {
91590
+ if (parsedNode.type === 'paragraph' && 'children' in parsedNode && parsedNode.children) {
91591
+ return parsedNode.children;
91592
+ }
91593
+ return [parsedNode];
91594
+ });
91595
+ rowChildren.push({
91596
+ type: tableTypes[name],
91597
+ children: parsedChildren,
91598
+ position: cellPosition,
91599
+ });
91600
+ });
91601
+ children.push({
91602
+ type: 'tableRow',
91603
+ children: rowChildren,
91604
+ position: row.position,
91605
+ });
91873
91606
  });
91874
91607
  }
91875
91608
  });
@@ -91889,54 +91622,35 @@ const processTableNode = (node, index, parent) => {
91889
91622
  /**
91890
91623
  * Converts JSX Table elements to markdown table nodes and re-parses markdown in cells.
91891
91624
  *
91892
- * Since mdxish doesn't use remarkMdx, we manually parse cell contents through
91893
- * remarkParse and remarkGfm to convert markdown to MDAST nodes.
91625
+ * The jsxTable micromark tokenizer captures `<Table>...</Table>` as a single html node,
91626
+ * preventing CommonMark HTML block type 6 from fragmenting it at blank lines. This
91627
+ * transformer then re-parses the html node with remarkMdx to produce proper JSX AST nodes
91628
+ * and converts them to MDAST table/tableRow/tableCell nodes.
91629
+ *
91630
+ * When cell content contains block-level nodes (callouts, code blocks, etc.), the table
91631
+ * is kept as a JSX <Table> element so that remarkRehype can properly handle the flow content.
91894
91632
  */
91895
91633
  const mdxishTables = () => tree => {
91896
- // First, handle MDX JSX elements (already converted by mdxishComponentBlocks)
91897
- visit(tree, isMDXElement, (node, index, parent) => {
91898
- if (node.name === 'Table') {
91899
- processTableNode(node, index, parent);
91900
- return SKIP;
91901
- }
91902
- });
91903
- // Also handle HTML and raw nodes that contain Table tags (in case mdxishComponentBlocks didn't convert them)
91904
- // This happens when the entire <Table>...</Table> block is in a single HTML node, which mdxishComponentBlocks
91905
- // doesn't handle (it only handles split nodes: opening tag, content paragraph, closing tag)
91906
- const handleTableInNode = (node, index, parent) => {
91634
+ visit(tree, 'html', (_node, index, parent) => {
91635
+ const node = _node;
91907
91636
  if (typeof index !== 'number' || !parent || !('children' in parent))
91908
91637
  return;
91909
- if (typeof node.value !== 'string')
91910
- return;
91911
- if (!node.value.includes('<Table') || !node.value.includes('</Table>'))
91638
+ if (!node.value.startsWith('<Table'))
91912
91639
  return;
91913
91640
  try {
91914
- // Parse the HTML content with remarkMdx and mdxishComponentBlocks to convert it to MDX JSX elements
91915
- // This creates a proper AST that we can then process
91916
91641
  const parsed = tableNodeProcessor.runSync(tableNodeProcessor.parse(node.value));
91917
- // Find the Table element in the parsed result and process it
91918
91642
  visit(parsed, isMDXElement, (tableNode) => {
91919
91643
  if (tableNode.name === 'Table') {
91920
- // Process the table and replace the HTML node with a markdown table node
91921
91644
  processTableNode(tableNode, index, parent);
91645
+ // Stop after the outermost Table so nested Tables don't overwrite parent.children[index]
91646
+ // we let it get handled naturally
91647
+ return EXIT;
91922
91648
  }
91923
91649
  });
91924
91650
  }
91925
91651
  catch {
91926
91652
  // If parsing fails, leave the node as-is
91927
91653
  }
91928
- };
91929
- // Handle HTML nodes (created by remark-parse for HTML blocks)
91930
- visit(tree, 'html', (node, index, parent) => {
91931
- if (typeof index === 'number' && parent && 'children' in parent) {
91932
- handleTableInNode(node, index, parent);
91933
- }
91934
- });
91935
- // Handle raw nodes (created by remark-parse for certain HTML structures)
91936
- visit(tree, 'raw', (node, index, parent) => {
91937
- if (typeof index === 'number' && parent && 'children' in parent) {
91938
- handleTableInNode(node, index, parent);
91939
- }
91940
91654
  });
91941
91655
  return tree;
91942
91656
  };
@@ -112432,10 +112146,6 @@ const compile_list_item_listItem = (node, parent, state, info) => {
112432
112146
  const plain_plain = (node) => node.value;
112433
112147
  /* harmony default export */ const compile_plain = (plain_plain);
112434
112148
 
112435
- ;// ./processor/compile/variable.ts
112436
- const variable = (node) => `{user.${node.data?.hProperties?.name || ''}}`;
112437
- /* harmony default export */ const compile_variable = (variable);
112438
-
112439
112149
  ;// ./processor/compile/index.ts
112440
112150
 
112441
112151
 
@@ -114104,7 +113814,7 @@ function getComponentName(componentName, components) {
114104
113814
 
114105
113815
 
114106
113816
 
114107
- const mdxish_components_INLINE_COMPONENT_TAGS = new Set(['anchor', 'glossary']);
113817
+ const INLINE_COMPONENT_TAGS = new Set(['anchor', 'glossary']);
114108
113818
  function isElementContentNode(node) {
114109
113819
  return node.type === 'element' || node.type === 'text' || node.type === 'comment';
114110
113820
  }
@@ -114186,7 +113896,7 @@ function parseTextChildren(node, processMarkdown, components) {
114186
113896
  const hast = processMarkdown(child.value.trim());
114187
113897
  const children = (hast.children ?? []).filter(isElementContentNode);
114188
113898
  // For inline components, preserve plain text instead of wrapping in <p>
114189
- if (mdxish_components_INLINE_COMPONENT_TAGS.has(node.tagName.toLowerCase()) && isSingleParagraphTextNode(children)) {
113899
+ if (INLINE_COMPONENT_TAGS.has(node.tagName.toLowerCase()) && isSingleParagraphTextNode(children)) {
114190
113900
  return [child];
114191
113901
  }
114192
113902
  return children;
@@ -114814,110 +114524,468 @@ const evaluateExpressions = ({ context = {} } = {}) => tree => {
114814
114524
  };
114815
114525
  /* harmony default export */ const evaluate_expressions = (evaluateExpressions);
114816
114526
 
114817
- ;// ./processor/transform/mdxish/heading-slugs.ts
114527
+ ;// ./processor/transform/mdxish/heading-slugs.ts
114528
+
114529
+
114530
+ function isHeading(node) {
114531
+ return /^h[1-6]$/.test(node.tagName);
114532
+ }
114533
+ function textContent(node) {
114534
+ if (node.type === 'text')
114535
+ return node.value;
114536
+ // Process variable nodes by using their variable name for the id generation
114537
+ if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
114538
+ if (node.properties.isLegacy) {
114539
+ return node.properties.name;
114540
+ }
114541
+ return `user.${node.properties.name}`;
114542
+ }
114543
+ if ('children' in node)
114544
+ return node.children.map(textContent).join('');
114545
+ return '';
114546
+ }
114547
+ /**
114548
+ * Rehype plugin that constructs ids for headings
114549
+ * Id's are used to construct slug anchor links & Table of Contents during rendering
114550
+ * Use the text / nodes that make up the heading to generate the id
114551
+ */
114552
+ const generateSlugForHeadings = () => (tree) => {
114553
+ const slugger = new BananaSlug();
114554
+ visit(tree, 'element', (node) => {
114555
+ if (isHeading(node) && !node.properties.id) {
114556
+ const text = node.children.map(textContent).join('');
114557
+ node.properties.id = slugger.slug(text);
114558
+ }
114559
+ });
114560
+ return tree;
114561
+ };
114562
+ /* harmony default export */ const heading_slugs = (generateSlugForHeadings);
114563
+
114564
+ // EXTERNAL MODULE: ./node_modules/@readme/variable/dist/index.js
114565
+ var variable_dist = __webpack_require__(4355);
114566
+ var variable_dist_default = /*#__PURE__*/__webpack_require__.n(variable_dist);
114567
+ ;// ./node_modules/rehype-parse/lib/index.js
114568
+ /**
114569
+ * @import {Root} from 'hast'
114570
+ * @import {Options as FromHtmlOptions} from 'hast-util-from-html'
114571
+ * @import {Parser, Processor} from 'unified'
114572
+ */
114573
+
114574
+ /**
114575
+ * @typedef {Omit<FromHtmlOptions, 'onerror'> & RehypeParseFields} Options
114576
+ * Configuration.
114577
+ *
114578
+ * @typedef RehypeParseFields
114579
+ * Extra fields.
114580
+ * @property {boolean | null | undefined} [emitParseErrors=false]
114581
+ * Whether to emit parse errors while parsing (default: `false`).
114582
+ *
114583
+ * > 👉 **Note**: parse errors are currently being added to HTML.
114584
+ * > Not all errors emitted by parse5 (or us) are specced yet.
114585
+ * > Some documentation may still be missing.
114586
+ */
114587
+
114588
+
114589
+
114590
+ /**
114591
+ * Plugin to add support for parsing from HTML.
114592
+ *
114593
+ * > 👉 **Note**: this is not an XML parser.
114594
+ * > It supports SVG as embedded in HTML.
114595
+ * > It does not support the features available in XML.
114596
+ * > Passing SVG files might break but fragments of modern SVG should be fine.
114597
+ * > Use [`xast-util-from-xml`][xast-util-from-xml] to parse XML.
114598
+ *
114599
+ * @param {Options | null | undefined} [options]
114600
+ * Configuration (optional).
114601
+ * @returns {undefined}
114602
+ * Nothing.
114603
+ */
114604
+ function rehypeParse(options) {
114605
+ /** @type {Processor<Root>} */
114606
+ // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.
114607
+ const self = this
114608
+ const {emitParseErrors, ...settings} = {...self.data('settings'), ...options}
114609
+
114610
+ self.parser = parser
114611
+
114612
+ /**
114613
+ * @type {Parser<Root>}
114614
+ */
114615
+ function parser(document, file) {
114616
+ return fromHtml(document, {
114617
+ ...settings,
114618
+ onerror: emitParseErrors
114619
+ ? function (message) {
114620
+ if (file.path) {
114621
+ message.name = file.path + ':' + message.name
114622
+ message.file = file.path
114623
+ }
114624
+
114625
+ file.messages.push(message)
114626
+ }
114627
+ : undefined
114628
+ })
114629
+ }
114630
+ }
114631
+
114632
+ ;// ./lib/mdast-util/empty-task-list-item/index.ts
114633
+ /**
114634
+ * Normalizes list items that are written as only `[ ]` or `[x]` into GFM task
114635
+ * list items during parse, but only when at least one whitespace character
114636
+ * follows the closing bracket (`]`). This matches legacy behaviour for checkboxes
114637
+ *
114638
+ * The issue is `remark-gfm` does not actually classify these as task items when they have no content
114639
+ * after the checkbox, which leaves them as plain text (`"[ ]"`). So a custom extension is needed to
114640
+ * treat these as task items
114641
+ */
114642
+ function exitListItemWithEmptyTaskListItem(token) {
114643
+ const node = this.stack[this.stack.length - 1];
114644
+ if (node &&
114645
+ node.type === 'listItem' &&
114646
+ typeof node.checked !== 'boolean') {
114647
+ const listItem = node;
114648
+ const head = listItem.children[0];
114649
+ if (head && head.type === 'paragraph' && head.children.length === 1) {
114650
+ const text = head.children[0];
114651
+ if (text.type === 'text') {
114652
+ const hasTrailingWhitespace = typeof head.position?.end.offset === 'number' &&
114653
+ typeof text.position?.end.offset === 'number' &&
114654
+ head.position.end.offset > text.position.end.offset;
114655
+ if (!hasTrailingWhitespace) {
114656
+ this.exit(token);
114657
+ return;
114658
+ }
114659
+ const value = text.value;
114660
+ if (value === '[ ]') {
114661
+ listItem.checked = false;
114662
+ head.children = [];
114663
+ }
114664
+ else if (value === '[x]' || value === '[X]') {
114665
+ listItem.checked = true;
114666
+ head.children = [];
114667
+ }
114668
+ }
114669
+ }
114670
+ }
114671
+ this.exit(token);
114672
+ }
114673
+ function emptyTaskListItemFromMarkdown() {
114674
+ return {
114675
+ exit: {
114676
+ listItem: exitListItemWithEmptyTaskListItem,
114677
+ },
114678
+ };
114679
+ }
114680
+
114681
+ ;// ./lib/mdast-util/legacy-variable/index.ts
114682
+
114683
+ const contextMap = new WeakMap();
114684
+ function findlegacyVariableToken() {
114685
+ // tokenStack is micromark's current open token ancestry; find the nearest legacyVariable token.
114686
+ const events = this.tokenStack;
114687
+ for (let i = events.length - 1; i >= 0; i -= 1) {
114688
+ const token = events[i][0];
114689
+ if (token.type === 'legacyVariable')
114690
+ return token;
114691
+ }
114692
+ return undefined;
114693
+ }
114694
+ function enterlegacyVariable(token) {
114695
+ contextMap.set(token, { value: '' });
114696
+ }
114697
+ function exitlegacyVariableValue(token) {
114698
+ const variableToken = findlegacyVariableToken.call(this);
114699
+ if (!variableToken)
114700
+ return;
114701
+ const ctx = contextMap.get(variableToken);
114702
+ // Build up the variable characters
114703
+ if (ctx)
114704
+ ctx.value += this.sliceSerialize(token);
114705
+ }
114706
+ function exitlegacyVariable(token) {
114707
+ const ctx = contextMap.get(token);
114708
+ const serialized = this.sliceSerialize(token);
114709
+ const variableName = serialized.startsWith('<<') && serialized.endsWith('>>')
114710
+ ? serialized.slice(2, -2)
114711
+ : ctx?.value ?? '';
114712
+ const nodePosition = {
114713
+ start: {
114714
+ offset: token.start.offset,
114715
+ line: token.start.line,
114716
+ column: token.start.column,
114717
+ },
114718
+ end: {
114719
+ offset: token.end.offset,
114720
+ line: token.end.line,
114721
+ column: token.end.column,
114722
+ },
114723
+ };
114724
+ if (variableName.startsWith('glossary:')) {
114725
+ const term = variableName.slice('glossary:'.length).trim();
114726
+ this.enter({
114727
+ type: NodeTypes.glossary,
114728
+ data: {
114729
+ hName: 'Glossary',
114730
+ hProperties: { term },
114731
+ },
114732
+ children: [{ type: 'text', value: term }],
114733
+ position: nodePosition,
114734
+ }, token);
114735
+ this.exit(token);
114736
+ contextMap.delete(token);
114737
+ return;
114738
+ }
114739
+ this.enter({
114740
+ type: NodeTypes.variable,
114741
+ data: {
114742
+ hName: 'Variable',
114743
+ hProperties: { name: variableName.trim(), isLegacy: true },
114744
+ },
114745
+ value: `<<${variableName}>>`,
114746
+ }, token);
114747
+ this.exit(token);
114748
+ contextMap.delete(token);
114749
+ }
114750
+ function legacyVariableFromMarkdown() {
114751
+ return {
114752
+ enter: {
114753
+ legacyVariable: enterlegacyVariable,
114754
+ },
114755
+ exit: {
114756
+ legacyVariableValue: exitlegacyVariableValue,
114757
+ legacyVariable: exitlegacyVariable,
114758
+ },
114759
+ };
114760
+ }
114761
+
114762
+ ;// ./node_modules/micromark-util-symbol/lib/codes.js
114763
+ /**
114764
+ * Character codes.
114765
+ *
114766
+ * This module is compiled away!
114767
+ *
114768
+ * micromark works based on character codes.
114769
+ * This module contains constants for the ASCII block and the replacement
114770
+ * character.
114771
+ * A couple of them are handled in a special way, such as the line endings
114772
+ * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
114773
+ * tab) and its expansion based on what column it’s at (virtual space),
114774
+ * and the end-of-file (eof) character.
114775
+ * As values are preprocessed before handling them, the actual characters LF,
114776
+ * CR, HT, and NUL (which is present as the replacement character), are
114777
+ * guaranteed to not exist.
114778
+ *
114779
+ * Unicode basic latin block.
114780
+ */
114781
+ const codes = /** @type {const} */ ({
114782
+ carriageReturn: -5,
114783
+ lineFeed: -4,
114784
+ carriageReturnLineFeed: -3,
114785
+ horizontalTab: -2,
114786
+ virtualSpace: -1,
114787
+ eof: null,
114788
+ nul: 0,
114789
+ soh: 1,
114790
+ stx: 2,
114791
+ etx: 3,
114792
+ eot: 4,
114793
+ enq: 5,
114794
+ ack: 6,
114795
+ bel: 7,
114796
+ bs: 8,
114797
+ ht: 9, // `\t`
114798
+ lf: 10, // `\n`
114799
+ vt: 11, // `\v`
114800
+ ff: 12, // `\f`
114801
+ cr: 13, // `\r`
114802
+ so: 14,
114803
+ si: 15,
114804
+ dle: 16,
114805
+ dc1: 17,
114806
+ dc2: 18,
114807
+ dc3: 19,
114808
+ dc4: 20,
114809
+ nak: 21,
114810
+ syn: 22,
114811
+ etb: 23,
114812
+ can: 24,
114813
+ em: 25,
114814
+ sub: 26,
114815
+ esc: 27,
114816
+ fs: 28,
114817
+ gs: 29,
114818
+ rs: 30,
114819
+ us: 31,
114820
+ space: 32,
114821
+ exclamationMark: 33, // `!`
114822
+ quotationMark: 34, // `"`
114823
+ numberSign: 35, // `#`
114824
+ dollarSign: 36, // `$`
114825
+ percentSign: 37, // `%`
114826
+ ampersand: 38, // `&`
114827
+ apostrophe: 39, // `'`
114828
+ leftParenthesis: 40, // `(`
114829
+ rightParenthesis: 41, // `)`
114830
+ asterisk: 42, // `*`
114831
+ plusSign: 43, // `+`
114832
+ comma: 44, // `,`
114833
+ dash: 45, // `-`
114834
+ dot: 46, // `.`
114835
+ slash: 47, // `/`
114836
+ digit0: 48, // `0`
114837
+ digit1: 49, // `1`
114838
+ digit2: 50, // `2`
114839
+ digit3: 51, // `3`
114840
+ digit4: 52, // `4`
114841
+ digit5: 53, // `5`
114842
+ digit6: 54, // `6`
114843
+ digit7: 55, // `7`
114844
+ digit8: 56, // `8`
114845
+ digit9: 57, // `9`
114846
+ colon: 58, // `:`
114847
+ semicolon: 59, // `;`
114848
+ lessThan: 60, // `<`
114849
+ equalsTo: 61, // `=`
114850
+ greaterThan: 62, // `>`
114851
+ questionMark: 63, // `?`
114852
+ atSign: 64, // `@`
114853
+ uppercaseA: 65, // `A`
114854
+ uppercaseB: 66, // `B`
114855
+ uppercaseC: 67, // `C`
114856
+ uppercaseD: 68, // `D`
114857
+ uppercaseE: 69, // `E`
114858
+ uppercaseF: 70, // `F`
114859
+ uppercaseG: 71, // `G`
114860
+ uppercaseH: 72, // `H`
114861
+ uppercaseI: 73, // `I`
114862
+ uppercaseJ: 74, // `J`
114863
+ uppercaseK: 75, // `K`
114864
+ uppercaseL: 76, // `L`
114865
+ uppercaseM: 77, // `M`
114866
+ uppercaseN: 78, // `N`
114867
+ uppercaseO: 79, // `O`
114868
+ uppercaseP: 80, // `P`
114869
+ uppercaseQ: 81, // `Q`
114870
+ uppercaseR: 82, // `R`
114871
+ uppercaseS: 83, // `S`
114872
+ uppercaseT: 84, // `T`
114873
+ uppercaseU: 85, // `U`
114874
+ uppercaseV: 86, // `V`
114875
+ uppercaseW: 87, // `W`
114876
+ uppercaseX: 88, // `X`
114877
+ uppercaseY: 89, // `Y`
114878
+ uppercaseZ: 90, // `Z`
114879
+ leftSquareBracket: 91, // `[`
114880
+ backslash: 92, // `\`
114881
+ rightSquareBracket: 93, // `]`
114882
+ caret: 94, // `^`
114883
+ underscore: 95, // `_`
114884
+ graveAccent: 96, // `` ` ``
114885
+ lowercaseA: 97, // `a`
114886
+ lowercaseB: 98, // `b`
114887
+ lowercaseC: 99, // `c`
114888
+ lowercaseD: 100, // `d`
114889
+ lowercaseE: 101, // `e`
114890
+ lowercaseF: 102, // `f`
114891
+ lowercaseG: 103, // `g`
114892
+ lowercaseH: 104, // `h`
114893
+ lowercaseI: 105, // `i`
114894
+ lowercaseJ: 106, // `j`
114895
+ lowercaseK: 107, // `k`
114896
+ lowercaseL: 108, // `l`
114897
+ lowercaseM: 109, // `m`
114898
+ lowercaseN: 110, // `n`
114899
+ lowercaseO: 111, // `o`
114900
+ lowercaseP: 112, // `p`
114901
+ lowercaseQ: 113, // `q`
114902
+ lowercaseR: 114, // `r`
114903
+ lowercaseS: 115, // `s`
114904
+ lowercaseT: 116, // `t`
114905
+ lowercaseU: 117, // `u`
114906
+ lowercaseV: 118, // `v`
114907
+ lowercaseW: 119, // `w`
114908
+ lowercaseX: 120, // `x`
114909
+ lowercaseY: 121, // `y`
114910
+ lowercaseZ: 122, // `z`
114911
+ leftCurlyBrace: 123, // `{`
114912
+ verticalBar: 124, // `|`
114913
+ rightCurlyBrace: 125, // `}`
114914
+ tilde: 126, // `~`
114915
+ del: 127,
114916
+ // Unicode Specials block.
114917
+ byteOrderMarker: 65_279,
114918
+ // Unicode Specials block.
114919
+ replacementCharacter: 65_533 // `�`
114920
+ })
114921
+
114922
+ ;// ./lib/micromark/legacy-variable/syntax.ts
114818
114923
 
114819
114924
 
114820
- function isHeading(node) {
114821
- return /^h[1-6]$/.test(node.tagName);
114925
+ function isAllowedValueChar(code) {
114926
+ return (code !== null &&
114927
+ code !== codes.lessThan &&
114928
+ code !== codes.greaterThan &&
114929
+ !markdownLineEnding(code));
114822
114930
  }
114823
- function textContent(node) {
114824
- if (node.type === 'text')
114825
- return node.value;
114826
- // Process variable nodes by using their variable name for the id generation
114827
- if (node.type === 'element' && node.tagName === 'variable' && node.properties?.name) {
114828
- if (node.properties.isLegacy) {
114829
- return node.properties.name;
114931
+ const legacyVariableConstruct = {
114932
+ name: 'legacyVariable',
114933
+ tokenize,
114934
+ };
114935
+ function tokenize(effects, ok, nok) {
114936
+ let hasValue = false;
114937
+ const start = (code) => {
114938
+ if (code !== codes.lessThan)
114939
+ return nok(code);
114940
+ effects.enter('legacyVariable');
114941
+ effects.enter('legacyVariableMarkerStart');
114942
+ effects.consume(code); // <
114943
+ return open2;
114944
+ };
114945
+ const open2 = (code) => {
114946
+ if (code !== codes.lessThan)
114947
+ return nok(code);
114948
+ effects.consume(code); // <<
114949
+ effects.exit('legacyVariableMarkerStart');
114950
+ effects.enter('legacyVariableValue');
114951
+ return value;
114952
+ };
114953
+ const value = (code) => {
114954
+ if (code === codes.greaterThan) {
114955
+ if (!hasValue)
114956
+ return nok(code);
114957
+ effects.exit('legacyVariableValue');
114958
+ effects.enter('legacyVariableMarkerEnd');
114959
+ effects.consume(code); // >
114960
+ return close2;
114830
114961
  }
114831
- return `user.${node.properties.name}`;
114832
- }
114833
- if ('children' in node)
114834
- return node.children.map(textContent).join('');
114835
- return '';
114962
+ if (!isAllowedValueChar(code))
114963
+ return nok(code);
114964
+ hasValue = true;
114965
+ effects.consume(code);
114966
+ return value;
114967
+ };
114968
+ const close2 = (code) => {
114969
+ if (code !== codes.greaterThan)
114970
+ return nok(code);
114971
+ effects.consume(code); // >>
114972
+ effects.exit('legacyVariableMarkerEnd');
114973
+ effects.exit('legacyVariable');
114974
+ return ok;
114975
+ };
114976
+ return start;
114977
+ }
114978
+ function legacyVariable() {
114979
+ return {
114980
+ text: { [codes.lessThan]: legacyVariableConstruct },
114981
+ };
114836
114982
  }
114837
- /**
114838
- * Rehype plugin that constructs ids for headings
114839
- * Id's are used to construct slug anchor links & Table of Contents during rendering
114840
- * Use the text / nodes that make up the heading to generate the id
114841
- */
114842
- const generateSlugForHeadings = () => (tree) => {
114843
- const slugger = new BananaSlug();
114844
- visit(tree, 'element', (node) => {
114845
- if (isHeading(node) && !node.properties.id) {
114846
- const text = node.children.map(textContent).join('');
114847
- node.properties.id = slugger.slug(text);
114848
- }
114849
- });
114850
- return tree;
114851
- };
114852
- /* harmony default export */ const heading_slugs = (generateSlugForHeadings);
114853
-
114854
- // EXTERNAL MODULE: ./node_modules/@readme/variable/dist/index.js
114855
- var variable_dist = __webpack_require__(4355);
114856
- var variable_dist_default = /*#__PURE__*/__webpack_require__.n(variable_dist);
114857
- ;// ./node_modules/rehype-parse/lib/index.js
114858
- /**
114859
- * @import {Root} from 'hast'
114860
- * @import {Options as FromHtmlOptions} from 'hast-util-from-html'
114861
- * @import {Parser, Processor} from 'unified'
114862
- */
114863
-
114864
- /**
114865
- * @typedef {Omit<FromHtmlOptions, 'onerror'> & RehypeParseFields} Options
114866
- * Configuration.
114867
- *
114868
- * @typedef RehypeParseFields
114869
- * Extra fields.
114870
- * @property {boolean | null | undefined} [emitParseErrors=false]
114871
- * Whether to emit parse errors while parsing (default: `false`).
114872
- *
114873
- * > 👉 **Note**: parse errors are currently being added to HTML.
114874
- * > Not all errors emitted by parse5 (or us) are specced yet.
114875
- * > Some documentation may still be missing.
114876
- */
114877
-
114878
-
114879
114983
 
114984
+ ;// ./lib/micromark/legacy-variable/index.ts
114880
114985
  /**
114881
- * Plugin to add support for parsing from HTML.
114882
- *
114883
- * > 👉 **Note**: this is not an XML parser.
114884
- * > It supports SVG as embedded in HTML.
114885
- * > It does not support the features available in XML.
114886
- * > Passing SVG files might break but fragments of modern SVG should be fine.
114887
- * > Use [`xast-util-from-xml`][xast-util-from-xml] to parse XML.
114888
- *
114889
- * @param {Options | null | undefined} [options]
114890
- * Configuration (optional).
114891
- * @returns {undefined}
114892
- * Nothing.
114986
+ * Micromark extension for <<variable>> / <<glossary:term>> inline syntax.
114893
114987
  */
114894
- function rehypeParse(options) {
114895
- /** @type {Processor<Root>} */
114896
- // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.
114897
- const self = this
114898
- const {emitParseErrors, ...settings} = {...self.data('settings'), ...options}
114899
-
114900
- self.parser = parser
114901
-
114902
- /**
114903
- * @type {Parser<Root>}
114904
- */
114905
- function parser(document, file) {
114906
- return fromHtml(document, {
114907
- ...settings,
114908
- onerror: emitParseErrors
114909
- ? function (message) {
114910
- if (file.path) {
114911
- message.name = file.path + ':' + message.name
114912
- message.file = file.path
114913
- }
114914
114988
 
114915
- file.messages.push(message)
114916
- }
114917
- : undefined
114918
- })
114919
- }
114920
- }
114921
114989
 
114922
114990
  ;// ./node_modules/entities/lib/esm/generated/encode-html.js
114923
114991
  // Generated using scripts/write-encode-map.ts
@@ -115224,349 +115292,6 @@ function looseHtmlEntityFromMarkdown() {
115224
115292
  */
115225
115293
 
115226
115294
 
115227
- ;// ./processor/transform/mdxish/normalize-malformed-md-syntax.ts
115228
-
115229
- // Marker patterns for multi-node emphasis detection
115230
- const MARKER_PATTERNS = [
115231
- { isBold: true, marker: '**' },
115232
- { isBold: true, marker: '__' },
115233
- { isBold: false, marker: '*' },
115234
- { isBold: false, marker: '_' },
115235
- ];
115236
- // Patterns to detect for bold (** and __) and italic (* and _) syntax:
115237
- // Bold: ** text**, **text **, word** text**, ** text **
115238
- // Italic: * text*, *text *, word* text*, * text *
115239
- // Same patterns for underscore variants
115240
- // We use separate patterns for each marker type to allow this flexibility.
115241
- // Pattern for ** bold **
115242
- // Groups: 1=wordBefore, 2=marker, 3=contentWithSpaceAfter, 4=trailingSpace1, 5=contentWithSpaceBefore, 6=trailingSpace2, 7=afterChar
115243
- // trailingSpace1 is for "** text **" pattern, trailingSpace2 is for "**text **" pattern
115244
- const asteriskBoldRegex = /([^*\s]+)?\s*(\*\*)(?:\s+((?:[^*\n]|\*(?!\*))+?)(\s*)\2|((?:[^*\n]|\*(?!\*))+?)(\s+)\2)(\S|$)?/g;
115245
- // Pattern for __ bold __
115246
- const underscoreBoldRegex = /([^_\s]+)?\s*(__)(?:\s+((?:__(?! )|_(?!_)|[^_\n])+?)(\s*)\2|((?:__(?! )|_(?!_)|[^_\n])+?)(\s+)\2)(\S|$)?/g;
115247
- // Pattern for * italic *
115248
- const asteriskItalicRegex = /([^*\s]+)?\s*(\*)(?!\*)(?:\s+([^*\n]+?)(\s*)\2|([^*\n]+?)(\s+)\2)(\S|$)?/g;
115249
- // Pattern for _ italic _
115250
- const underscoreItalicRegex = /([^_\s]+)?\s*(_)(?!_)(?:\s+((?:[^_\n]|_(?! ))+?)(\s*)\2|((?:[^_\n]|_(?! ))+?)(\s+)\2)(\S|$)?/g;
115251
- // CommonMark ignores intraword underscores or asteriks, but we want to italicize/bold the inner part
115252
- // Pattern for intraword _word_ in words like hello_world_
115253
- const intrawordUnderscoreItalicRegex = /(\w)_(?!_)([a-zA-Z0-9]+)_(?![\w_])/g;
115254
- // Pattern for intraword __word__ in words like hello__world__
115255
- const intrawordUnderscoreBoldRegex = /(\w)__([a-zA-Z0-9]+)__(?![\w_])/g;
115256
- // Pattern for intraword *word* in words like hello*world*
115257
- const intrawordAsteriskItalicRegex = /(\w)\*(?!\*)([a-zA-Z0-9]+)\*(?![\w*])/g;
115258
- // Pattern for intraword **word** in words like hello**world**
115259
- const intrawordAsteriskBoldRegex = /(\w)\*\*([a-zA-Z0-9]+)\*\*(?![\w*])/g;
115260
- /**
115261
- * Finds opening emphasis marker in a text value.
115262
- * Returns marker info if found, null otherwise.
115263
- */
115264
- function findOpeningMarker(text) {
115265
- const results = MARKER_PATTERNS.map(({ isBold, marker }) => {
115266
- if (marker === '*' && text.startsWith('**'))
115267
- return null;
115268
- if (marker === '_' && text.startsWith('__'))
115269
- return null;
115270
- if (text.startsWith(marker) && text.length > marker.length) {
115271
- return { isBold, marker, textAfter: text.slice(marker.length), textBefore: '' };
115272
- }
115273
- const idx = text.indexOf(marker);
115274
- if (idx > 0 && !/\s/.test(text[idx - 1])) {
115275
- if (marker === '*' && text.slice(idx).startsWith('**'))
115276
- return null;
115277
- if (marker === '_' && text.slice(idx).startsWith('__'))
115278
- return null;
115279
- const after = text.slice(idx + marker.length);
115280
- if (after.length > 0) {
115281
- return { isBold, marker, textAfter: after, textBefore: text.slice(0, idx) };
115282
- }
115283
- }
115284
- return null;
115285
- });
115286
- return results.find(r => r !== null) ?? null;
115287
- }
115288
- /**
115289
- * Finds the end/closing marker in a text node for multi-node emphasis.
115290
- */
115291
- function findEndMarker(text, marker) {
115292
- const spacePattern = ` ${marker}`;
115293
- const spaceIdx = text.indexOf(spacePattern);
115294
- if (spaceIdx >= 0) {
115295
- if (marker === '*' && text.slice(spaceIdx + 1).startsWith('**'))
115296
- return null;
115297
- if (marker === '_' && text.slice(spaceIdx + 1).startsWith('__'))
115298
- return null;
115299
- return {
115300
- textAfter: text.slice(spaceIdx + spacePattern.length),
115301
- textBefore: text.slice(0, spaceIdx),
115302
- };
115303
- }
115304
- if (text.startsWith(marker)) {
115305
- if (marker === '*' && text.startsWith('**'))
115306
- return null;
115307
- if (marker === '_' && text.startsWith('__'))
115308
- return null;
115309
- return {
115310
- textAfter: text.slice(marker.length),
115311
- textBefore: '',
115312
- };
115313
- }
115314
- return null;
115315
- }
115316
- /**
115317
- * Scan children for an opening emphasis marker in a text node.
115318
- */
115319
- function findOpeningInChildren(children) {
115320
- let result = null;
115321
- children.some((child, idx) => {
115322
- if (child.type !== 'text')
115323
- return false;
115324
- const found = findOpeningMarker(child.value);
115325
- if (found) {
115326
- result = { idx, opening: found };
115327
- return true;
115328
- }
115329
- return false;
115330
- });
115331
- return result;
115332
- }
115333
- /**
115334
- * Scan children (after openingIdx) for a closing emphasis marker.
115335
- */
115336
- function findClosingInChildren(children, openingIdx, marker) {
115337
- let result = null;
115338
- children.slice(openingIdx + 1).some((child, relativeIdx) => {
115339
- if (child.type !== 'text')
115340
- return false;
115341
- const found = findEndMarker(child.value, marker);
115342
- if (found) {
115343
- result = { closingIdx: openingIdx + 1 + relativeIdx, closing: found };
115344
- return true;
115345
- }
115346
- return false;
115347
- });
115348
- return result;
115349
- }
115350
- /**
115351
- * Build the replacement nodes for a matched emphasis pair.
115352
- */
115353
- function buildReplacementNodes(container, { opening, openingIdx, closing, closingIdx }) {
115354
- const newNodes = [];
115355
- if (opening.textBefore) {
115356
- newNodes.push({ type: 'text', value: `${opening.textBefore} ` });
115357
- }
115358
- const emphasisChildren = [];
115359
- const openingText = opening.textAfter.replace(/^\s+/, '');
115360
- if (openingText) {
115361
- emphasisChildren.push({ type: 'text', value: openingText });
115362
- }
115363
- container.children.slice(openingIdx + 1, closingIdx).forEach(child => {
115364
- emphasisChildren.push(child);
115365
- });
115366
- const closingText = closing.textBefore.replace(/\s+$/, '');
115367
- if (closingText) {
115368
- emphasisChildren.push({ type: 'text', value: closingText });
115369
- }
115370
- if (emphasisChildren.length > 0) {
115371
- const emphasisNode = opening.isBold
115372
- ? { type: 'strong', children: emphasisChildren }
115373
- : { type: 'emphasis', children: emphasisChildren };
115374
- newNodes.push(emphasisNode);
115375
- }
115376
- if (closing.textAfter) {
115377
- newNodes.push({ type: 'text', value: closing.textAfter });
115378
- }
115379
- return newNodes;
115380
- }
115381
- /**
115382
- * Find and transform one multi-node emphasis pair in the container.
115383
- * Returns true if a pair was found and transformed, false otherwise.
115384
- */
115385
- function processOneEmphasisPair(container) {
115386
- const openingResult = findOpeningInChildren(container.children);
115387
- if (!openingResult)
115388
- return false;
115389
- const { idx: openingIdx, opening } = openingResult;
115390
- const closingResult = findClosingInChildren(container.children, openingIdx, opening.marker);
115391
- if (!closingResult)
115392
- return false;
115393
- const { closingIdx, closing } = closingResult;
115394
- const newNodes = buildReplacementNodes(container, { opening, openingIdx, closing, closingIdx });
115395
- const deleteCount = closingIdx - openingIdx + 1;
115396
- container.children.splice(openingIdx, deleteCount, ...newNodes);
115397
- return true;
115398
- }
115399
- /**
115400
- * Handle malformed emphasis that spans multiple AST nodes.
115401
- * E.g., "**bold [link](url)**" where markers are in different text nodes.
115402
- */
115403
- function visitMultiNodeEmphasis(tree) {
115404
- const containerTypes = ['paragraph', 'heading', 'tableCell', 'listItem', 'blockquote'];
115405
- visit(tree, node => {
115406
- if (!containerTypes.includes(node.type))
115407
- return;
115408
- if (!('children' in node) || !Array.isArray(node.children))
115409
- return;
115410
- const container = node;
115411
- let foundPair = true;
115412
- while (foundPair) {
115413
- foundPair = processOneEmphasisPair(container);
115414
- }
115415
- });
115416
- }
115417
- /**
115418
- * A remark plugin that normalizes malformed bold and italic markers in text nodes.
115419
- * Detects patterns like `** bold**`, `Hello** Wrong Bold**`, `__ bold__`, `Hello__ Wrong Bold__`,
115420
- * `* italic*`, `Hello* Wrong Italic*`, `_ italic_`, or `Hello_ Wrong Italic_`
115421
- * and converts them to proper strong/emphasis nodes, matching the behavior of the legacy rdmd engine.
115422
- *
115423
- * Supports both asterisk (`**bold**`, `*italic*`) and underscore (`__bold__`, `_italic_`) syntax.
115424
- * Also supports snake_case content like `** some_snake_case**`.
115425
- *
115426
- * This runs after remark-parse, which (in v11+) is strict and doesn't parse
115427
- * malformed emphasis syntax. This plugin post-processes the AST to handle these cases.
115428
- */
115429
- const normalizeEmphasisAST = () => (tree) => {
115430
- visit(tree, 'text', function visitor(node, index, parent) {
115431
- if (index === undefined || !parent)
115432
- return undefined;
115433
- // Skip if inside code blocks or inline code
115434
- if (parent.type === 'inlineCode' || parent.type === 'code') {
115435
- return undefined;
115436
- }
115437
- const text = node.value;
115438
- const allMatches = [];
115439
- [...text.matchAll(asteriskBoldRegex)].forEach(match => {
115440
- allMatches.push({ isBold: true, marker: '**', match });
115441
- });
115442
- [...text.matchAll(underscoreBoldRegex)].forEach(match => {
115443
- allMatches.push({ isBold: true, marker: '__', match });
115444
- });
115445
- [...text.matchAll(asteriskItalicRegex)].forEach(match => {
115446
- allMatches.push({ isBold: false, marker: '*', match });
115447
- });
115448
- [...text.matchAll(underscoreItalicRegex)].forEach(match => {
115449
- allMatches.push({ isBold: false, marker: '_', match });
115450
- });
115451
- [...text.matchAll(intrawordUnderscoreItalicRegex)].forEach(match => {
115452
- allMatches.push({ isBold: false, isIntraword: true, marker: '_', match });
115453
- });
115454
- [...text.matchAll(intrawordUnderscoreBoldRegex)].forEach(match => {
115455
- allMatches.push({ isBold: true, isIntraword: true, marker: '__', match });
115456
- });
115457
- [...text.matchAll(intrawordAsteriskItalicRegex)].forEach(match => {
115458
- allMatches.push({ isBold: false, isIntraword: true, marker: '*', match });
115459
- });
115460
- [...text.matchAll(intrawordAsteriskBoldRegex)].forEach(match => {
115461
- allMatches.push({ isBold: true, isIntraword: true, marker: '**', match });
115462
- });
115463
- if (allMatches.length === 0)
115464
- return undefined;
115465
- allMatches.sort((a, b) => (a.match.index ?? 0) - (b.match.index ?? 0));
115466
- const filteredMatches = [];
115467
- let lastEnd = 0;
115468
- allMatches.forEach(info => {
115469
- const start = info.match.index ?? 0;
115470
- const end = start + info.match[0].length;
115471
- if (start >= lastEnd) {
115472
- filteredMatches.push(info);
115473
- lastEnd = end;
115474
- }
115475
- });
115476
- if (filteredMatches.length === 0)
115477
- return undefined;
115478
- const parts = [];
115479
- let lastIndex = 0;
115480
- filteredMatches.forEach(({ isBold, isIntraword, marker, match }) => {
115481
- const matchIndex = match.index ?? 0;
115482
- const fullMatch = match[0];
115483
- if (isIntraword) {
115484
- // handles cases like hello_world_ where we only want to italicize 'world'
115485
- const charBefore = match[1] || ''; // e.g., "l" in "hello_world_"
115486
- const content = match[2]; // e.g., "world"
115487
- const combinedBefore = text.slice(lastIndex, matchIndex) + charBefore;
115488
- if (combinedBefore) {
115489
- parts.push({ type: 'text', value: combinedBefore });
115490
- }
115491
- if (isBold) {
115492
- parts.push({
115493
- type: 'strong',
115494
- children: [{ type: 'text', value: content }],
115495
- });
115496
- }
115497
- else {
115498
- parts.push({
115499
- type: 'emphasis',
115500
- children: [{ type: 'text', value: content }],
115501
- });
115502
- }
115503
- lastIndex = matchIndex + fullMatch.length;
115504
- return;
115505
- }
115506
- if (matchIndex > lastIndex) {
115507
- const beforeText = text.slice(lastIndex, matchIndex);
115508
- if (beforeText) {
115509
- parts.push({ type: 'text', value: beforeText });
115510
- }
115511
- }
115512
- const wordBefore = match[1]; // e.g., "Hello" in "Hello** Wrong Bold**"
115513
- const contentWithSpaceAfter = match[3]; // Content when there's a space after opening markers
115514
- const trailingSpace1 = match[4] || ''; // Space before closing markers (for "** text **" pattern)
115515
- const contentWithSpaceBefore = match[5]; // Content when there's only a space before closing markers
115516
- const trailingSpace2 = match[6] || ''; // Space before closing markers (for "**text **" pattern)
115517
- const trailingSpace = trailingSpace1 || trailingSpace2; // Combined trailing space
115518
- const content = (contentWithSpaceAfter || contentWithSpaceBefore || '').trim();
115519
- const afterChar = match[7]; // Character after closing markers (if any)
115520
- const markerPos = fullMatch.indexOf(marker);
115521
- const spacesBeforeMarkers = wordBefore
115522
- ? fullMatch.slice(wordBefore.length, markerPos)
115523
- : fullMatch.slice(0, markerPos);
115524
- const shouldAddSpace = !!contentWithSpaceAfter && !!wordBefore && !spacesBeforeMarkers;
115525
- if (wordBefore) {
115526
- const spacing = spacesBeforeMarkers + (shouldAddSpace ? ' ' : '');
115527
- parts.push({ type: 'text', value: wordBefore + spacing });
115528
- }
115529
- else if (spacesBeforeMarkers) {
115530
- parts.push({ type: 'text', value: spacesBeforeMarkers });
115531
- }
115532
- if (content) {
115533
- if (isBold) {
115534
- parts.push({
115535
- type: 'strong',
115536
- children: [{ type: 'text', value: content }],
115537
- });
115538
- }
115539
- else {
115540
- parts.push({
115541
- type: 'emphasis',
115542
- children: [{ type: 'text', value: content }],
115543
- });
115544
- }
115545
- }
115546
- if (afterChar) {
115547
- const prefix = trailingSpace ? ' ' : '';
115548
- parts.push({ type: 'text', value: prefix + afterChar });
115549
- }
115550
- lastIndex = matchIndex + fullMatch.length;
115551
- });
115552
- if (lastIndex < text.length) {
115553
- const remainingText = text.slice(lastIndex);
115554
- if (remainingText) {
115555
- parts.push({ type: 'text', value: remainingText });
115556
- }
115557
- }
115558
- if (parts.length > 0) {
115559
- parent.children.splice(index, 1, ...parts);
115560
- return [SKIP, index + parts.length];
115561
- }
115562
- return undefined;
115563
- });
115564
- // Handle malformed emphasis spanning multiple nodes (e.g., **text [link](url) **)
115565
- visitMultiNodeEmphasis(tree);
115566
- return tree;
115567
- };
115568
- /* harmony default export */ const normalize_malformed_md_syntax = (normalizeEmphasisAST);
115569
-
115570
115295
  ;// ./processor/transform/mdxish/magic-blocks/patterns.ts
115571
115296
  /** Matches HTML tags (open, close, self-closing) with optional attributes. */
115572
115297
  const HTML_TAG_RE = /<\/?([a-zA-Z][a-zA-Z0-9-]*)((?:[^>"']*(?:"[^"]*"|'[^']*'))*[^>"']*)>/g;
@@ -116184,6 +115909,336 @@ const magicBlockTransformer = (options = {}) => tree => {
116184
115909
  };
116185
115910
  /* harmony default export */ const magic_block_transformer = (magicBlockTransformer);
116186
115911
 
115912
+ ;// ./processor/transform/mdxish/constants.ts
115913
+ /**
115914
+ * Inline component tags handled by mdxish-inline-components.ts.
115915
+ * Also excluded from block-level handling in mdxish-component-blocks.ts.
115916
+ */
115917
+ const constants_INLINE_COMPONENT_TAGS = new Set(['Anchor']);
115918
+
115919
+ ;// ./processor/transform/mdxish/mdxish-component-blocks.ts
115920
+
115921
+
115922
+
115923
+
115924
+
115925
+
115926
+
115927
+ const pascalCaseTagPattern = /^<([A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>([\s\S]*)?$/;
115928
+ const tagAttributePattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+))?/g;
115929
+ /**
115930
+ * Maximum number of siblings to scan forward when looking for a closing tag
115931
+ * to avoid scanning too far and degrading performance
115932
+ */
115933
+ const MAX_LOOKAHEAD = 30;
115934
+ /**
115935
+ * Tags that have dedicated transformers and should NOT be handled by this plugin.
115936
+ * These components either have special parsing requirements that the generic component
115937
+ * block transformer cannot handle correctly, or are inline components that we don't
115938
+ * want to convert to mdxJsxFlowElement which is a block level element.
115939
+ */
115940
+ const EXCLUDED_TAGS = new Set(['HTMLBlock', 'Table', 'Glossary', ...constants_INLINE_COMPONENT_TAGS]);
115941
+ const inlineMdProcessor = unified()
115942
+ .data('micromarkExtensions', [legacyVariable()])
115943
+ .data('fromMarkdownExtensions', [legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown()])
115944
+ .use(remarkParse)
115945
+ .use(remarkGfm);
115946
+ const isClosingTag = (value, tag) => value.trim() === `</${tag}>`;
115947
+ /**
115948
+ * Parse markdown content into mdast children nodes.
115949
+ */
115950
+ const parseMdChildren = (value) => {
115951
+ const parsed = inlineMdProcessor.parse(value);
115952
+ return parsed.children || [];
115953
+ };
115954
+ /**
115955
+ * Convert raw attribute string into mdxJsxAttribute entries.
115956
+ * Handles both key-value attributes (theme="info") and boolean attributes (empty).
115957
+ */
115958
+ const parseAttributes = (raw) => {
115959
+ const attributes = [];
115960
+ const attrString = raw.trim();
115961
+ if (!attrString)
115962
+ return attributes;
115963
+ tagAttributePattern.lastIndex = 0;
115964
+ let match = tagAttributePattern.exec(attrString);
115965
+ while (match !== null) {
115966
+ const [, attrName, attrValue] = match;
115967
+ const value = attrValue ? attrValue.replace(/^['"]|['"]$/g, '') : null;
115968
+ attributes.push({ type: 'mdxJsxAttribute', name: attrName, value });
115969
+ match = tagAttributePattern.exec(attrString);
115970
+ }
115971
+ return attributes;
115972
+ };
115973
+ /**
115974
+ * Parse an HTML tag string into structured data.
115975
+ */
115976
+ const parseTag = (value) => {
115977
+ const match = value.match(pascalCaseTagPattern);
115978
+ if (!match)
115979
+ return null;
115980
+ const [, tag, attrString = '', selfClosing = '', contentAfterTag = ''] = match;
115981
+ return {
115982
+ tag,
115983
+ attributes: parseAttributes(attrString),
115984
+ selfClosing: !!selfClosing,
115985
+ contentAfterTag,
115986
+ };
115987
+ };
115988
+ /**
115989
+ * Parse substring content of a node and update the parent's children to include the new nodes.
115990
+ */
115991
+ const parseSibling = (stack, parent, index, sibling) => {
115992
+ const siblingNodes = parseMdChildren(sibling);
115993
+ // The new sibling nodes might contain new components to be processed
115994
+ if (siblingNodes.length > 0) {
115995
+ parent.children.splice(index + 1, 0, ...siblingNodes);
115996
+ stack.push(parent);
115997
+ }
115998
+ };
115999
+ /**
116000
+ * Create an MdxJsxFlowElement node from component data.
116001
+ */
116002
+ const createComponentNode = ({ tag, attributes, children, startPosition, endPosition }) => ({
116003
+ type: 'mdxJsxFlowElement',
116004
+ name: tag,
116005
+ attributes,
116006
+ children,
116007
+ position: {
116008
+ start: startPosition?.start,
116009
+ end: endPosition?.end ?? startPosition?.end,
116010
+ },
116011
+ });
116012
+ /**
116013
+ * Remove a closing tag from a paragraph's children and return the updated paragraph.
116014
+ */
116015
+ const stripClosingTagFromParagraph = (node, tag) => {
116016
+ if (!Array.isArray(node.children))
116017
+ return { paragraph: node, found: false };
116018
+ const children = [...node.children];
116019
+ const closingIndex = children.findIndex(child => child.type === 'html' && isClosingTag(child.value || '', tag));
116020
+ if (closingIndex === -1)
116021
+ return { paragraph: node, found: false };
116022
+ children.splice(closingIndex, 1);
116023
+ return { paragraph: { ...node, children }, found: true };
116024
+ };
116025
+ /**
116026
+ * Scan forward through siblings to find a closing tag.
116027
+ * Handles:
116028
+ * - Exact match HTML siblings (e.g., `</Tag>`)
116029
+ * - HTML siblings with embedded closing tag (e.g., `...\n</Tag>`)
116030
+ * - Paragraph siblings containing the closing tag as a child
116031
+ *
116032
+ * Returns null if not found within MAX_LOOKAHEAD siblings
116033
+ */
116034
+ const scanForClosingTag = (parent, startIndex, tag) => {
116035
+ const closingTagStr = `</${tag}>`;
116036
+ const maxIndex = Math.min(startIndex + MAX_LOOKAHEAD, parent.children.length);
116037
+ let i = startIndex + 1;
116038
+ for (; i < maxIndex; i += 1) {
116039
+ const sibling = parent.children[i];
116040
+ // Check HTML siblings
116041
+ if (sibling.type === 'html') {
116042
+ const siblingValue = sibling.value || '';
116043
+ // Exact match (standalone closing tag)
116044
+ if (isClosingTag(siblingValue, tag)) {
116045
+ return { closingIndex: i, extraClosingChildren: [] };
116046
+ }
116047
+ // Embedded closing tag (closing tag within HTML block content)
116048
+ if (siblingValue.includes(closingTagStr)) {
116049
+ const closeTagPos = siblingValue.indexOf(closingTagStr);
116050
+ const contentBeforeClose = siblingValue.substring(0, closeTagPos).trim();
116051
+ const contentAfterClose = siblingValue.substring(closeTagPos + closingTagStr.length).trim();
116052
+ const extraChildren = contentBeforeClose
116053
+ ? parseMdChildren(contentBeforeClose)
116054
+ : [];
116055
+ return { closingIndex: i, extraClosingChildren: extraChildren, contentAfterClose: contentAfterClose || undefined };
116056
+ }
116057
+ }
116058
+ // Check paragraph siblings
116059
+ if (sibling.type === 'paragraph') {
116060
+ const { paragraph, found } = stripClosingTagFromParagraph(sibling, tag);
116061
+ if (found) {
116062
+ return { closingIndex: i, extraClosingChildren: [], strippedParagraph: paragraph };
116063
+ }
116064
+ }
116065
+ }
116066
+ if (i < parent.children.length) {
116067
+ // eslint-disable-next-line no-console
116068
+ console.warn(`Closing tag </${tag}> not found within ${MAX_LOOKAHEAD} siblings, stopping scan`);
116069
+ }
116070
+ return null;
116071
+ };
116072
+ const substituteNodeWithMdxNode = (parent, index, mdxNode) => {
116073
+ parent.children.splice(index, 1, mdxNode);
116074
+ };
116075
+ /**
116076
+ * Transform PascalCase HTML nodes into mdxJsxFlowElement nodes.
116077
+ *
116078
+ * Remark parses unknown/custom component tags as raw HTML nodes.
116079
+ * These are the custom readme MDX syntax for components.
116080
+ * This transformer identifies these patterns and converts them to proper MDX JSX elements so they
116081
+ * can be accurately recognized and rendered later with their component definition code.
116082
+ * Though for some tags, we need to handle them specially
116083
+ *
116084
+ * ## Supported HTML Structures
116085
+ *
116086
+ * ### 1. Self-closing tags
116087
+ * ```
116088
+ * <Component />
116089
+ * ```
116090
+ * Parsed as: `html: "<Component />"`
116091
+ *
116092
+ * ### 2. Self-contained blocks (entire component in single HTML node)
116093
+ * ```
116094
+ * <Button>Click me</Button>
116095
+ * ```
116096
+ * ```
116097
+ * <Component>
116098
+ * <h2>Title</h2>
116099
+ * <p>Content</p>
116100
+ * </Component>
116101
+ * ```
116102
+ * Parsed as: `html: "<Component>\n <h2>Title</h2>\n <p>Content</p>\n</Component>"`
116103
+ * The opening tag, content, and closing tag are all captured in one HTML node.
116104
+ *
116105
+ * ### 3. Multi-sibling components (closing tag in a following sibling)
116106
+ * Handles various structures where the closing tag is in a later sibling, such as:
116107
+ *
116108
+ * #### 3a. Block components (closing tag in sibling paragraph)
116109
+ * ```
116110
+ * <Callout>
116111
+ * Some **markdown** content
116112
+ * </Callout>
116113
+ * ```
116114
+ *
116115
+ * #### 3b. Multi-paragraph components (closing tag several siblings away)
116116
+ * ```
116117
+ * <Callout>
116118
+ *
116119
+ * First paragraph
116120
+ *
116121
+ * Second paragraph
116122
+ * </Callout>
116123
+ * ```
116124
+ *
116125
+ * #### 3c. Nested components split by blank lines (closing tag embedded in HTML sibling)
116126
+ * ```
116127
+ * <Outer>
116128
+ * <Inner>content</Inner>
116129
+ *
116130
+ * <Inner>content</Inner>
116131
+ * </Outer>
116132
+ * ```
116133
+ */
116134
+ const mdxishComponentBlocks = () => tree => {
116135
+ const stack = [tree];
116136
+ const processChildNode = (parent, index) => {
116137
+ const node = parent.children[index];
116138
+ if (!node)
116139
+ return;
116140
+ if ('children' in node && Array.isArray(node.children)) {
116141
+ stack.push(node);
116142
+ }
116143
+ // Only visit HTML nodes with an actual html tag,
116144
+ // which means a potential unparsed MDX component
116145
+ const value = node.value;
116146
+ if (node.type !== 'html' || typeof value !== 'string')
116147
+ return;
116148
+ const parsed = parseTag(value.trim());
116149
+ if (!parsed)
116150
+ return;
116151
+ const { tag, attributes, selfClosing, contentAfterTag = '' } = parsed;
116152
+ // Skip tags that have dedicated transformers
116153
+ if (EXCLUDED_TAGS.has(tag))
116154
+ return;
116155
+ const closingTagStr = `</${tag}>`;
116156
+ // Case 1: Self-closing tag
116157
+ if (selfClosing) {
116158
+ const componentNode = createComponentNode({
116159
+ tag,
116160
+ attributes,
116161
+ children: [],
116162
+ startPosition: node.position,
116163
+ });
116164
+ substituteNodeWithMdxNode(parent, index, componentNode);
116165
+ // Check and parse if there's relevant content after the current closing tag
116166
+ const remainingContent = contentAfterTag.trim();
116167
+ if (remainingContent) {
116168
+ parseSibling(stack, parent, index, remainingContent);
116169
+ }
116170
+ return;
116171
+ }
116172
+ // Case 2: Self-contained block (closing tag in content)
116173
+ if (contentAfterTag.includes(closingTagStr)) {
116174
+ // Find the first closing tag
116175
+ const closingTagIndex = contentAfterTag.indexOf(closingTagStr);
116176
+ const componentInnerContent = contentAfterTag.substring(0, closingTagIndex).trim();
116177
+ const contentAfterClose = contentAfterTag.substring(closingTagIndex + closingTagStr.length).trim();
116178
+ const componentNode = createComponentNode({
116179
+ tag,
116180
+ attributes,
116181
+ children: componentInnerContent ? parseMdChildren(componentInnerContent) : [],
116182
+ startPosition: node.position,
116183
+ });
116184
+ substituteNodeWithMdxNode(parent, index, componentNode);
116185
+ // After the closing tag, there might be more content to be processed
116186
+ if (contentAfterClose) {
116187
+ parseSibling(stack, parent, index, contentAfterClose);
116188
+ }
116189
+ else if (componentNode.children.length > 0) {
116190
+ // The content inside the component block might contain new components to be processed
116191
+ stack.push(componentNode);
116192
+ }
116193
+ return;
116194
+ }
116195
+ // Case 3: Multi-sibling component (closing tag in a following sibling)
116196
+ // Scans forward through siblings to find closing tag in HTML or paragraph nodes
116197
+ const scanResult = scanForClosingTag(parent, index, tag);
116198
+ if (!scanResult)
116199
+ return;
116200
+ const { closingIndex, extraClosingChildren, strippedParagraph, contentAfterClose: remainingAfterClose } = scanResult;
116201
+ const extraChildren = contentAfterTag ? parseMdChildren(contentAfterTag.trimStart()) : [];
116202
+ // Collect all intermediate siblings between opening tag and closing tag
116203
+ const intermediateChildren = parent.children.slice(index + 1, closingIndex);
116204
+ // For paragraph siblings, include the full paragraph (with closing tag stripped)
116205
+ // For HTML siblings, include any content parsed from before the closing tag
116206
+ const closingChildren = strippedParagraph
116207
+ ? (strippedParagraph.children.length > 0 ? [strippedParagraph] : [])
116208
+ : extraClosingChildren;
116209
+ const componentNode = createComponentNode({
116210
+ tag,
116211
+ attributes,
116212
+ children: [...extraChildren, ...intermediateChildren, ...closingChildren],
116213
+ startPosition: node.position,
116214
+ endPosition: parent.children[closingIndex]?.position,
116215
+ });
116216
+ // Remove all nodes from opening tag to closing tag (inclusive) and replace with component node
116217
+ parent.children.splice(index, closingIndex - index + 1, componentNode);
116218
+ // Since we might be merging sibling nodes together and combining content,
116219
+ // there might be new components to process
116220
+ if (componentNode.children.length > 0) {
116221
+ stack.push(componentNode);
116222
+ }
116223
+ // If the closing tag sibling had content after it (e.g., another component opening tag),
116224
+ // re-insert it as a sibling so it can be processed in subsequent iterations
116225
+ if (remainingAfterClose) {
116226
+ parseSibling(stack, parent, index, remainingAfterClose);
116227
+ }
116228
+ };
116229
+ // Process the nodes with the components depth-first to maintain the correct order of the nodes
116230
+ while (stack.length) {
116231
+ const parent = stack.pop();
116232
+ if (parent?.children) {
116233
+ parent.children.forEach((_child, index) => {
116234
+ processChildNode(parent, index);
116235
+ });
116236
+ }
116237
+ }
116238
+ return tree;
116239
+ };
116240
+ /* harmony default export */ const mdxish_component_blocks = (mdxishComponentBlocks);
116241
+
116187
116242
  ;// ./processor/transform/mdxish/mdxish-html-blocks.ts
116188
116243
 
116189
116244
 
@@ -116549,7 +116604,7 @@ const mdxishInlineComponents = () => tree => {
116549
116604
  if (!match)
116550
116605
  return;
116551
116606
  const [, name, attrStr] = match;
116552
- if (!INLINE_COMPONENT_TAGS.has(name))
116607
+ if (!constants_INLINE_COMPONENT_TAGS.has(name))
116553
116608
  return;
116554
116609
  // Parse attributes directly - preserves all attribute types (strings, booleans, objects, arrays)
116555
116610
  const attributes = parseAttributes(attrStr ?? '');
@@ -116850,12 +116905,6 @@ const mdxishMermaidTransformer = () => (tree) => {
116850
116905
  };
116851
116906
  /* harmony default export */ const mdxish_mermaid = (mdxishMermaidTransformer);
116852
116907
 
116853
- ;// ./lib/constants.ts
116854
- /**
116855
- * Pattern to match component tags (PascalCase or snake_case)
116856
- */
116857
- const componentTagPattern = /<(\/?[A-Z][A-Za-z0-9_]*)([^>]*?)(\/?)>/g;
116858
-
116859
116908
  ;// ./processor/transform/mdxish/mdxish-snake-case-components.ts
116860
116909
 
116861
116910
 
@@ -117291,6 +117340,49 @@ const variablesTextTransformer = () => tree => {
117291
117340
  };
117292
117341
  /* harmony default export */ const variables_text = (variablesTextTransformer);
117293
117342
 
117343
+ ;// ./lib/mdast-util/jsx-table/index.ts
117344
+ const jsx_table_contextMap = new WeakMap();
117345
+ function findJsxTableToken() {
117346
+ const events = this.tokenStack;
117347
+ for (let i = events.length - 1; i >= 0; i -= 1) {
117348
+ if (events[i][0].type === 'jsxTable')
117349
+ return events[i][0];
117350
+ }
117351
+ return undefined;
117352
+ }
117353
+ function enterJsxTable(token) {
117354
+ jsx_table_contextMap.set(token, { chunks: [] });
117355
+ this.enter({ type: 'html', value: '' }, token);
117356
+ }
117357
+ function exitJsxTableData(token) {
117358
+ const tableToken = findJsxTableToken.call(this);
117359
+ if (!tableToken)
117360
+ return;
117361
+ const ctx = jsx_table_contextMap.get(tableToken);
117362
+ if (ctx)
117363
+ ctx.chunks.push(this.sliceSerialize(token));
117364
+ }
117365
+ function exitJsxTable(token) {
117366
+ const ctx = jsx_table_contextMap.get(token);
117367
+ const node = this.stack[this.stack.length - 1];
117368
+ if (ctx) {
117369
+ node.value = ctx.chunks.join('\n');
117370
+ jsx_table_contextMap.delete(token);
117371
+ }
117372
+ this.exit(token);
117373
+ }
117374
+ function jsxTableFromMarkdown() {
117375
+ return {
117376
+ enter: {
117377
+ jsxTable: enterJsxTable,
117378
+ },
117379
+ exit: {
117380
+ jsxTableData: exitJsxTableData,
117381
+ jsxTable: exitJsxTable,
117382
+ },
117383
+ };
117384
+ }
117385
+
117294
117386
  ;// ./lib/mdast-util/magic-block/index.ts
117295
117387
  const magic_block_contextMap = new WeakMap();
117296
117388
  /**
@@ -117447,6 +117539,685 @@ function magicBlockToMarkdown() {
117447
117539
  };
117448
117540
  }
117449
117541
 
117542
+ ;// ./node_modules/micromark-util-symbol/lib/types.js
117543
+ /**
117544
+ * This module is compiled away!
117545
+ *
117546
+ * Here is the list of all types of tokens exposed by micromark, with a short
117547
+ * explanation of what they include and where they are found.
117548
+ * In picking names, generally, the rule is to be as explicit as possible
117549
+ * instead of reusing names.
117550
+ * For example, there is a `definitionDestination` and a `resourceDestination`,
117551
+ * instead of one shared name.
117552
+ */
117553
+
117554
+ // Note: when changing the next record, you must also change `TokenTypeMap`
117555
+ // in `micromark-util-types/index.d.ts`.
117556
+ const types_types = /** @type {const} */ ({
117557
+ // Generic type for data, such as in a title, a destination, etc.
117558
+ data: 'data',
117559
+
117560
+ // Generic type for syntactic whitespace (tabs, virtual spaces, spaces).
117561
+ // Such as, between a fenced code fence and an info string.
117562
+ whitespace: 'whitespace',
117563
+
117564
+ // Generic type for line endings (line feed, carriage return, carriage return +
117565
+ // line feed).
117566
+ lineEnding: 'lineEnding',
117567
+
117568
+ // A line ending, but ending a blank line.
117569
+ lineEndingBlank: 'lineEndingBlank',
117570
+
117571
+ // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a
117572
+ // line.
117573
+ linePrefix: 'linePrefix',
117574
+
117575
+ // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a
117576
+ // line.
117577
+ lineSuffix: 'lineSuffix',
117578
+
117579
+ // Whole ATX heading:
117580
+ //
117581
+ // ```markdown
117582
+ // #
117583
+ // ## Alpha
117584
+ // ### Bravo ###
117585
+ // ```
117586
+ //
117587
+ // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`.
117588
+ atxHeading: 'atxHeading',
117589
+
117590
+ // Sequence of number signs in an ATX heading (`###`).
117591
+ atxHeadingSequence: 'atxHeadingSequence',
117592
+
117593
+ // Content in an ATX heading (`alpha`).
117594
+ // Includes text.
117595
+ atxHeadingText: 'atxHeadingText',
117596
+
117597
+ // Whole autolink (`<https://example.com>` or `<admin@example.com>`)
117598
+ // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`.
117599
+ autolink: 'autolink',
117600
+
117601
+ // Email autolink w/o markers (`admin@example.com`)
117602
+ autolinkEmail: 'autolinkEmail',
117603
+
117604
+ // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`).
117605
+ autolinkMarker: 'autolinkMarker',
117606
+
117607
+ // Protocol autolink w/o markers (`https://example.com`)
117608
+ autolinkProtocol: 'autolinkProtocol',
117609
+
117610
+ // A whole character escape (`\-`).
117611
+ // Includes `escapeMarker` and `characterEscapeValue`.
117612
+ characterEscape: 'characterEscape',
117613
+
117614
+ // The escaped character (`-`).
117615
+ characterEscapeValue: 'characterEscapeValue',
117616
+
117617
+ // A whole character reference (`&amp;`, `&#8800;`, or `&#x1D306;`).
117618
+ // Includes `characterReferenceMarker`, an optional
117619
+ // `characterReferenceMarkerNumeric`, in which case an optional
117620
+ // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`.
117621
+ characterReference: 'characterReference',
117622
+
117623
+ // The start or end marker (`&` or `;`).
117624
+ characterReferenceMarker: 'characterReferenceMarker',
117625
+
117626
+ // Mark reference as numeric (`#`).
117627
+ characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric',
117628
+
117629
+ // Mark reference as numeric (`x` or `X`).
117630
+ characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal',
117631
+
117632
+ // Value of character reference w/o markers (`amp`, `8800`, or `1D306`).
117633
+ characterReferenceValue: 'characterReferenceValue',
117634
+
117635
+ // Whole fenced code:
117636
+ //
117637
+ // ````markdown
117638
+ // ```js
117639
+ // alert(1)
117640
+ // ```
117641
+ // ````
117642
+ codeFenced: 'codeFenced',
117643
+
117644
+ // A fenced code fence, including whitespace, sequence, info, and meta
117645
+ // (` ```js `).
117646
+ codeFencedFence: 'codeFencedFence',
117647
+
117648
+ // Sequence of grave accent or tilde characters (` ``` `) in a fence.
117649
+ codeFencedFenceSequence: 'codeFencedFenceSequence',
117650
+
117651
+ // Info word (`js`) in a fence.
117652
+ // Includes string.
117653
+ codeFencedFenceInfo: 'codeFencedFenceInfo',
117654
+
117655
+ // Meta words (`highlight="1"`) in a fence.
117656
+ // Includes string.
117657
+ codeFencedFenceMeta: 'codeFencedFenceMeta',
117658
+
117659
+ // A line of code.
117660
+ codeFlowValue: 'codeFlowValue',
117661
+
117662
+ // Whole indented code:
117663
+ //
117664
+ // ```markdown
117665
+ // alert(1)
117666
+ // ```
117667
+ //
117668
+ // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`.
117669
+ codeIndented: 'codeIndented',
117670
+
117671
+ // A text code (``` `alpha` ```).
117672
+ // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include
117673
+ // `codeTextPadding`.
117674
+ codeText: 'codeText',
117675
+
117676
+ codeTextData: 'codeTextData',
117677
+
117678
+ // A space or line ending right after or before a tick.
117679
+ codeTextPadding: 'codeTextPadding',
117680
+
117681
+ // A text code fence (` `` `).
117682
+ codeTextSequence: 'codeTextSequence',
117683
+
117684
+ // Whole content:
117685
+ //
117686
+ // ```markdown
117687
+ // [a]: b
117688
+ // c
117689
+ // =
117690
+ // d
117691
+ // ```
117692
+ //
117693
+ // Includes `paragraph` and `definition`.
117694
+ content: 'content',
117695
+ // Whole definition:
117696
+ //
117697
+ // ```markdown
117698
+ // [micromark]: https://github.com/micromark/micromark
117699
+ // ```
117700
+ //
117701
+ // Includes `definitionLabel`, `definitionMarker`, `whitespace`,
117702
+ // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`.
117703
+ definition: 'definition',
117704
+
117705
+ // Destination of a definition (`https://github.com/micromark/micromark` or
117706
+ // `<https://github.com/micromark/micromark>`).
117707
+ // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`.
117708
+ definitionDestination: 'definitionDestination',
117709
+
117710
+ // Enclosed destination of a definition
117711
+ // (`<https://github.com/micromark/micromark>`).
117712
+ // Includes `definitionDestinationLiteralMarker` and optionally
117713
+ // `definitionDestinationString`.
117714
+ definitionDestinationLiteral: 'definitionDestinationLiteral',
117715
+
117716
+ // Markers of an enclosed definition destination (`<` or `>`).
117717
+ definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker',
117718
+
117719
+ // Unenclosed destination of a definition
117720
+ // (`https://github.com/micromark/micromark`).
117721
+ // Includes `definitionDestinationString`.
117722
+ definitionDestinationRaw: 'definitionDestinationRaw',
117723
+
117724
+ // Text in an destination (`https://github.com/micromark/micromark`).
117725
+ // Includes string.
117726
+ definitionDestinationString: 'definitionDestinationString',
117727
+
117728
+ // Label of a definition (`[micromark]`).
117729
+ // Includes `definitionLabelMarker` and `definitionLabelString`.
117730
+ definitionLabel: 'definitionLabel',
117731
+
117732
+ // Markers of a definition label (`[` or `]`).
117733
+ definitionLabelMarker: 'definitionLabelMarker',
117734
+
117735
+ // Value of a definition label (`micromark`).
117736
+ // Includes string.
117737
+ definitionLabelString: 'definitionLabelString',
117738
+
117739
+ // Marker between a label and a destination (`:`).
117740
+ definitionMarker: 'definitionMarker',
117741
+
117742
+ // Title of a definition (`"x"`, `'y'`, or `(z)`).
117743
+ // Includes `definitionTitleMarker` and optionally `definitionTitleString`.
117744
+ definitionTitle: 'definitionTitle',
117745
+
117746
+ // Marker around a title of a definition (`"`, `'`, `(`, or `)`).
117747
+ definitionTitleMarker: 'definitionTitleMarker',
117748
+
117749
+ // Data without markers in a title (`z`).
117750
+ // Includes string.
117751
+ definitionTitleString: 'definitionTitleString',
117752
+
117753
+ // Emphasis (`*alpha*`).
117754
+ // Includes `emphasisSequence` and `emphasisText`.
117755
+ emphasis: 'emphasis',
117756
+
117757
+ // Sequence of emphasis markers (`*` or `_`).
117758
+ emphasisSequence: 'emphasisSequence',
117759
+
117760
+ // Emphasis text (`alpha`).
117761
+ // Includes text.
117762
+ emphasisText: 'emphasisText',
117763
+
117764
+ // The character escape marker (`\`).
117765
+ escapeMarker: 'escapeMarker',
117766
+
117767
+ // A hard break created with a backslash (`\\n`).
117768
+ // Note: does not include the line ending.
117769
+ hardBreakEscape: 'hardBreakEscape',
117770
+
117771
+ // A hard break created with trailing spaces (` \n`).
117772
+ // Does not include the line ending.
117773
+ hardBreakTrailing: 'hardBreakTrailing',
117774
+
117775
+ // Flow HTML:
117776
+ //
117777
+ // ```markdown
117778
+ // <div
117779
+ // ```
117780
+ //
117781
+ // Inlcudes `lineEnding`, `htmlFlowData`.
117782
+ htmlFlow: 'htmlFlow',
117783
+
117784
+ htmlFlowData: 'htmlFlowData',
117785
+
117786
+ // HTML in text (the tag in `a <i> b`).
117787
+ // Includes `lineEnding`, `htmlTextData`.
117788
+ htmlText: 'htmlText',
117789
+
117790
+ htmlTextData: 'htmlTextData',
117791
+
117792
+ // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or
117793
+ // `![alpha]`).
117794
+ // Includes `label` and an optional `resource` or `reference`.
117795
+ image: 'image',
117796
+
117797
+ // Whole link label (`[*alpha*]`).
117798
+ // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`.
117799
+ label: 'label',
117800
+
117801
+ // Text in an label (`*alpha*`).
117802
+ // Includes text.
117803
+ labelText: 'labelText',
117804
+
117805
+ // Start a link label (`[`).
117806
+ // Includes a `labelMarker`.
117807
+ labelLink: 'labelLink',
117808
+
117809
+ // Start an image label (`![`).
117810
+ // Includes `labelImageMarker` and `labelMarker`.
117811
+ labelImage: 'labelImage',
117812
+
117813
+ // Marker of a label (`[` or `]`).
117814
+ labelMarker: 'labelMarker',
117815
+
117816
+ // Marker to start an image (`!`).
117817
+ labelImageMarker: 'labelImageMarker',
117818
+
117819
+ // End a label (`]`).
117820
+ // Includes `labelMarker`.
117821
+ labelEnd: 'labelEnd',
117822
+
117823
+ // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`).
117824
+ // Includes `label` and an optional `resource` or `reference`.
117825
+ link: 'link',
117826
+
117827
+ // Whole paragraph:
117828
+ //
117829
+ // ```markdown
117830
+ // alpha
117831
+ // bravo.
117832
+ // ```
117833
+ //
117834
+ // Includes text.
117835
+ paragraph: 'paragraph',
117836
+
117837
+ // A reference (`[alpha]` or `[]`).
117838
+ // Includes `referenceMarker` and an optional `referenceString`.
117839
+ reference: 'reference',
117840
+
117841
+ // A reference marker (`[` or `]`).
117842
+ referenceMarker: 'referenceMarker',
117843
+
117844
+ // Reference text (`alpha`).
117845
+ // Includes string.
117846
+ referenceString: 'referenceString',
117847
+
117848
+ // A resource (`(https://example.com "alpha")`).
117849
+ // Includes `resourceMarker`, an optional `resourceDestination` with an optional
117850
+ // `whitespace` and `resourceTitle`.
117851
+ resource: 'resource',
117852
+
117853
+ // A resource destination (`https://example.com`).
117854
+ // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`.
117855
+ resourceDestination: 'resourceDestination',
117856
+
117857
+ // A literal resource destination (`<https://example.com>`).
117858
+ // Includes `resourceDestinationLiteralMarker` and optionally
117859
+ // `resourceDestinationString`.
117860
+ resourceDestinationLiteral: 'resourceDestinationLiteral',
117861
+
117862
+ // A resource destination marker (`<` or `>`).
117863
+ resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker',
117864
+
117865
+ // A raw resource destination (`https://example.com`).
117866
+ // Includes `resourceDestinationString`.
117867
+ resourceDestinationRaw: 'resourceDestinationRaw',
117868
+
117869
+ // Resource destination text (`https://example.com`).
117870
+ // Includes string.
117871
+ resourceDestinationString: 'resourceDestinationString',
117872
+
117873
+ // A resource marker (`(` or `)`).
117874
+ resourceMarker: 'resourceMarker',
117875
+
117876
+ // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`).
117877
+ // Includes `resourceTitleMarker` and optionally `resourceTitleString`.
117878
+ resourceTitle: 'resourceTitle',
117879
+
117880
+ // A resource title marker (`"`, `'`, `(`, or `)`).
117881
+ resourceTitleMarker: 'resourceTitleMarker',
117882
+
117883
+ // Resource destination title (`alpha`).
117884
+ // Includes string.
117885
+ resourceTitleString: 'resourceTitleString',
117886
+
117887
+ // Whole setext heading:
117888
+ //
117889
+ // ```markdown
117890
+ // alpha
117891
+ // bravo
117892
+ // =====
117893
+ // ```
117894
+ //
117895
+ // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and
117896
+ // `setextHeadingLine`.
117897
+ setextHeading: 'setextHeading',
117898
+
117899
+ // Content in a setext heading (`alpha\nbravo`).
117900
+ // Includes text.
117901
+ setextHeadingText: 'setextHeadingText',
117902
+
117903
+ // Underline in a setext heading, including whitespace suffix (`==`).
117904
+ // Includes `setextHeadingLineSequence`.
117905
+ setextHeadingLine: 'setextHeadingLine',
117906
+
117907
+ // Sequence of equals or dash characters in underline in a setext heading (`-`).
117908
+ setextHeadingLineSequence: 'setextHeadingLineSequence',
117909
+
117910
+ // Strong (`**alpha**`).
117911
+ // Includes `strongSequence` and `strongText`.
117912
+ strong: 'strong',
117913
+
117914
+ // Sequence of strong markers (`**` or `__`).
117915
+ strongSequence: 'strongSequence',
117916
+
117917
+ // Strong text (`alpha`).
117918
+ // Includes text.
117919
+ strongText: 'strongText',
117920
+
117921
+ // Whole thematic break:
117922
+ //
117923
+ // ```markdown
117924
+ // * * *
117925
+ // ```
117926
+ //
117927
+ // Includes `thematicBreakSequence` and `whitespace`.
117928
+ thematicBreak: 'thematicBreak',
117929
+
117930
+ // A sequence of one or more thematic break markers (`***`).
117931
+ thematicBreakSequence: 'thematicBreakSequence',
117932
+
117933
+ // Whole block quote:
117934
+ //
117935
+ // ```markdown
117936
+ // > a
117937
+ // >
117938
+ // > b
117939
+ // ```
117940
+ //
117941
+ // Includes `blockQuotePrefix` and flow.
117942
+ blockQuote: 'blockQuote',
117943
+ // The `>` or `> ` of a block quote.
117944
+ blockQuotePrefix: 'blockQuotePrefix',
117945
+ // The `>` of a block quote prefix.
117946
+ blockQuoteMarker: 'blockQuoteMarker',
117947
+ // The optional ` ` of a block quote prefix.
117948
+ blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace',
117949
+
117950
+ // Whole ordered list:
117951
+ //
117952
+ // ```markdown
117953
+ // 1. a
117954
+ // b
117955
+ // ```
117956
+ //
117957
+ // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further
117958
+ // lines.
117959
+ listOrdered: 'listOrdered',
117960
+
117961
+ // Whole unordered list:
117962
+ //
117963
+ // ```markdown
117964
+ // - a
117965
+ // b
117966
+ // ```
117967
+ //
117968
+ // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further
117969
+ // lines.
117970
+ listUnordered: 'listUnordered',
117971
+
117972
+ // The indent of further list item lines.
117973
+ listItemIndent: 'listItemIndent',
117974
+
117975
+ // A marker, as in, `*`, `+`, `-`, `.`, or `)`.
117976
+ listItemMarker: 'listItemMarker',
117977
+
117978
+ // The thing that starts a list item, such as `1. `.
117979
+ // Includes `listItemValue` if ordered, `listItemMarker`, and
117980
+ // `listItemPrefixWhitespace` (unless followed by a line ending).
117981
+ listItemPrefix: 'listItemPrefix',
117982
+
117983
+ // The whitespace after a marker.
117984
+ listItemPrefixWhitespace: 'listItemPrefixWhitespace',
117985
+
117986
+ // The numerical value of an ordered item.
117987
+ listItemValue: 'listItemValue',
117988
+
117989
+ // Internal types used for subtokenizers, compiled away
117990
+ chunkDocument: 'chunkDocument',
117991
+ chunkContent: 'chunkContent',
117992
+ chunkFlow: 'chunkFlow',
117993
+ chunkText: 'chunkText',
117994
+ chunkString: 'chunkString'
117995
+ })
117996
+
117997
+ ;// ./lib/micromark/jsx-table/syntax.ts
117998
+
117999
+
118000
+ const syntax_nonLazyContinuationStart = {
118001
+ tokenize: syntax_tokenizeNonLazyContinuationStart,
118002
+ partial: true,
118003
+ };
118004
+ function resolveToJsxTable(events) {
118005
+ let index = events.length;
118006
+ while (index > 0) {
118007
+ index -= 1;
118008
+ if (events[index][0] === 'enter' && events[index][1].type === 'jsxTable') {
118009
+ break;
118010
+ }
118011
+ }
118012
+ if (index > 1 && events[index - 2][1].type === types_types.linePrefix) {
118013
+ events[index][1].start = events[index - 2][1].start;
118014
+ events[index + 1][1].start = events[index - 2][1].start;
118015
+ events.splice(index - 2, 2);
118016
+ }
118017
+ return events;
118018
+ }
118019
+ const jsxTableConstruct = {
118020
+ name: 'jsxTable',
118021
+ tokenize: tokenizeJsxTable,
118022
+ resolveTo: resolveToJsxTable,
118023
+ concrete: true,
118024
+ };
118025
+ function tokenizeJsxTable(effects, ok, nok) {
118026
+ let codeSpanOpenSize = 0;
118027
+ let codeSpanCloseSize = 0;
118028
+ let depth = 1;
118029
+ const TABLE_NAME = [codes.uppercaseT, codes.lowercaseA, codes.lowercaseB, codes.lowercaseL, codes.lowercaseE];
118030
+ const ABLE_SUFFIX = TABLE_NAME.slice(1);
118031
+ /** Build a state chain that matches a sequence of character codes. */
118032
+ function matchChars(chars, onMatch, onFail) {
118033
+ if (chars.length === 0)
118034
+ return onMatch;
118035
+ return ((code) => {
118036
+ if (code === chars[0]) {
118037
+ effects.consume(code);
118038
+ return matchChars(chars.slice(1), onMatch, onFail);
118039
+ }
118040
+ return onFail(code);
118041
+ });
118042
+ }
118043
+ return start;
118044
+ function start(code) {
118045
+ if (code !== codes.lessThan)
118046
+ return nok(code);
118047
+ effects.enter('jsxTable');
118048
+ effects.enter('jsxTableData');
118049
+ effects.consume(code);
118050
+ return matchChars(TABLE_NAME, afterTagName, nok);
118051
+ }
118052
+ function afterTagName(code) {
118053
+ if (code === codes.greaterThan || code === codes.slash || code === codes.space || code === codes.horizontalTab) {
118054
+ effects.consume(code);
118055
+ return body;
118056
+ }
118057
+ return nok(code);
118058
+ }
118059
+ function body(code) {
118060
+ // Reject unclosed <Table> so it falls back to normal HTML block parsing
118061
+ // instead of swallowing all subsequent content to EOF
118062
+ if (code === null) {
118063
+ return nok(code);
118064
+ }
118065
+ if (markdownLineEnding(code)) {
118066
+ effects.exit('jsxTableData');
118067
+ return continuationStart(code);
118068
+ }
118069
+ if (code === codes.backslash) {
118070
+ effects.consume(code);
118071
+ return escapedChar;
118072
+ }
118073
+ if (code === codes.lessThan) {
118074
+ effects.consume(code);
118075
+ return closeSlash;
118076
+ }
118077
+ // Skip over backtick code spans so `</Table>` in inline code isn't
118078
+ // treated as the closing tag
118079
+ if (code === codes.graveAccent) {
118080
+ codeSpanOpenSize = 0;
118081
+ return countOpenTicks(code);
118082
+ }
118083
+ effects.consume(code);
118084
+ return body;
118085
+ }
118086
+ function countOpenTicks(code) {
118087
+ if (code === codes.graveAccent) {
118088
+ codeSpanOpenSize += 1;
118089
+ effects.consume(code);
118090
+ return countOpenTicks;
118091
+ }
118092
+ return inCodeSpan(code);
118093
+ }
118094
+ function inCodeSpan(code) {
118095
+ if (code === null || markdownLineEnding(code))
118096
+ return body(code);
118097
+ if (code === codes.graveAccent) {
118098
+ codeSpanCloseSize = 0;
118099
+ return countCloseTicks(code);
118100
+ }
118101
+ effects.consume(code);
118102
+ return inCodeSpan;
118103
+ }
118104
+ function countCloseTicks(code) {
118105
+ if (code === codes.graveAccent) {
118106
+ codeSpanCloseSize += 1;
118107
+ effects.consume(code);
118108
+ return countCloseTicks;
118109
+ }
118110
+ return codeSpanCloseSize === codeSpanOpenSize ? body(code) : inCodeSpan(code);
118111
+ }
118112
+ function escapedChar(code) {
118113
+ if (code === null || markdownLineEnding(code)) {
118114
+ return body(code);
118115
+ }
118116
+ effects.consume(code);
118117
+ return body;
118118
+ }
118119
+ function closeSlash(code) {
118120
+ if (code === codes.slash) {
118121
+ effects.consume(code);
118122
+ return matchChars(TABLE_NAME, closeGt, body);
118123
+ }
118124
+ if (code === codes.uppercaseT) {
118125
+ effects.consume(code);
118126
+ return matchChars(ABLE_SUFFIX, openAfterTagName, body);
118127
+ }
118128
+ return body(code);
118129
+ }
118130
+ function openAfterTagName(code) {
118131
+ if (code === codes.greaterThan || code === codes.slash || code === codes.space || code === codes.horizontalTab) {
118132
+ depth += 1;
118133
+ effects.consume(code);
118134
+ return body;
118135
+ }
118136
+ return body(code);
118137
+ }
118138
+ function closeGt(code) {
118139
+ if (code === codes.greaterThan) {
118140
+ depth -= 1;
118141
+ effects.consume(code);
118142
+ if (depth === 0) {
118143
+ return afterClose;
118144
+ }
118145
+ return body;
118146
+ }
118147
+ return body(code);
118148
+ }
118149
+ function afterClose(code) {
118150
+ if (code === null || markdownLineEnding(code)) {
118151
+ effects.exit('jsxTableData');
118152
+ effects.exit('jsxTable');
118153
+ return ok(code);
118154
+ }
118155
+ effects.consume(code);
118156
+ return afterClose;
118157
+ }
118158
+ // Line ending handling — follows the htmlFlow pattern
118159
+ function continuationStart(code) {
118160
+ return effects.check(syntax_nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code);
118161
+ }
118162
+ function continuationStartNonLazy(code) {
118163
+ effects.enter(types_types.lineEnding);
118164
+ effects.consume(code);
118165
+ effects.exit(types_types.lineEnding);
118166
+ return continuationBefore;
118167
+ }
118168
+ function continuationBefore(code) {
118169
+ if (code === null || markdownLineEnding(code)) {
118170
+ return continuationStart(code);
118171
+ }
118172
+ effects.enter('jsxTableData');
118173
+ return body(code);
118174
+ }
118175
+ function continuationAfter(code) {
118176
+ // At EOF without </Table>, reject so content isn't swallowed
118177
+ if (code === null) {
118178
+ return nok(code);
118179
+ }
118180
+ effects.exit('jsxTable');
118181
+ return ok(code);
118182
+ }
118183
+ }
118184
+ function syntax_tokenizeNonLazyContinuationStart(effects, ok, nok) {
118185
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
118186
+ const self = this;
118187
+ return start;
118188
+ function start(code) {
118189
+ if (markdownLineEnding(code)) {
118190
+ effects.enter(types_types.lineEnding);
118191
+ effects.consume(code);
118192
+ effects.exit(types_types.lineEnding);
118193
+ return after;
118194
+ }
118195
+ return nok(code);
118196
+ }
118197
+ function after(code) {
118198
+ if (self.parser.lazy[self.now().line]) {
118199
+ return nok(code);
118200
+ }
118201
+ return ok(code);
118202
+ }
118203
+ }
118204
+ /**
118205
+ * Micromark extension that tokenizes `<Table>...</Table>` as a single flow block.
118206
+ *
118207
+ * Prevents CommonMark HTML block type 6 from matching `<Table>` (case-insensitive
118208
+ * match against `table`) and fragmenting it at blank lines.
118209
+ */
118210
+ function jsxTable() {
118211
+ return {
118212
+ flow: {
118213
+ [codes.lessThan]: [jsxTableConstruct],
118214
+ },
118215
+ };
118216
+ }
118217
+
118218
+ ;// ./lib/micromark/jsx-table/index.ts
118219
+
118220
+
117450
118221
  ;// ./lib/micromark/magic-block/syntax.ts
117451
118222
 
117452
118223
 
@@ -118375,6 +119146,8 @@ function loadComponents() {
118375
119146
 
118376
119147
 
118377
119148
 
119149
+
119150
+
118378
119151
 
118379
119152
 
118380
119153
 
@@ -118422,11 +119195,11 @@ function mdxishAstProcessor(mdContent, opts = {}) {
118422
119195
  };
118423
119196
  const processor = unified()
118424
119197
  .data('micromarkExtensions', safeMode
118425
- ? [magicBlock(), legacyVariable(), looseHtmlEntity()]
118426
- : [magicBlock(), mdxExprTextOnly, legacyVariable(), looseHtmlEntity()])
119198
+ ? [jsxTable(), magicBlock(), legacyVariable(), looseHtmlEntity()]
119199
+ : [jsxTable(), magicBlock(), mdxExprTextOnly, legacyVariable(), looseHtmlEntity()])
118427
119200
  .data('fromMarkdownExtensions', safeMode
118428
- ? [magicBlockFromMarkdown(), legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown(), looseHtmlEntityFromMarkdown()]
118429
- : [magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown(), looseHtmlEntityFromMarkdown()])
119201
+ ? [jsxTableFromMarkdown(), magicBlockFromMarkdown(), legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown(), looseHtmlEntityFromMarkdown()]
119202
+ : [jsxTableFromMarkdown(), magicBlockFromMarkdown(), mdxExpressionFromMarkdown(), legacyVariableFromMarkdown(), emptyTaskListItemFromMarkdown(), looseHtmlEntityFromMarkdown()])
118430
119203
  .use(remarkParse)
118431
119204
  .use(remarkFrontmatter)
118432
119205
  .use(normalize_malformed_md_syntax)
@@ -119046,6 +119819,8 @@ function restoreMagicBlocks(replaced, blocks) {
119046
119819
 
119047
119820
 
119048
119821
 
119822
+
119823
+
119049
119824
  /**
119050
119825
  * Removes Markdown and MDX comments.
119051
119826
  */
@@ -119057,8 +119832,8 @@ async function stripComments(doc, { mdx, mdxish } = {}) {
119057
119832
  // 2. we need to parse JSX comments into mdxTextExpression nodes so that the transformers can pick them up
119058
119833
  if (mdxish) {
119059
119834
  processor
119060
- .data('micromarkExtensions', [mdxExpression({ allowEmpty: true })])
119061
- .data('fromMarkdownExtensions', [mdxExpressionFromMarkdown()])
119835
+ .data('micromarkExtensions', [jsxTable(), mdxExpression({ allowEmpty: true })])
119836
+ .data('fromMarkdownExtensions', [jsxTableFromMarkdown(), mdxExpressionFromMarkdown()])
119062
119837
  .data('toMarkdownExtensions', [mdxExpressionToMarkdown()]);
119063
119838
  }
119064
119839
  processor