@readme/markdown 14.11.2 → 14.11.3

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.
@@ -92840,7 +92840,7 @@ function legacyVariableFromMarkdown() {
92840
92840
  *
92841
92841
  * Unicode basic latin block.
92842
92842
  */
92843
- const codes = /** @type {const} */ ({
92843
+ const codes_codes = /** @type {const} */ ({
92844
92844
  carriageReturn: -5,
92845
92845
  lineFeed: -4,
92846
92846
  carriageReturnLineFeed: -3,
@@ -92988,11 +92988,11 @@ const codes = /** @type {const} */ ({
92988
92988
  function isNameChar(code) {
92989
92989
  if (code === null)
92990
92990
  return false;
92991
- return ((code >= codes.lowercaseA && code <= codes.lowercaseZ) ||
92992
- (code >= codes.uppercaseA && code <= codes.uppercaseZ) ||
92993
- (code >= codes.digit0 && code <= codes.digit9) ||
92994
- code === codes.dash ||
92995
- code === codes.underscore);
92991
+ return ((code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ) ||
92992
+ (code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) ||
92993
+ (code >= codes_codes.digit0 && code <= codes_codes.digit9) ||
92994
+ code === codes_codes.dash ||
92995
+ code === codes_codes.underscore);
92996
92996
  }
92997
92997
  const gemojiConstruct = {
92998
92998
  name: 'gemoji',
@@ -93002,7 +93002,7 @@ function tokenize(effects, ok, nok) {
93002
93002
  let hasName = false;
93003
93003
  // Entry point — expect opening `:`
93004
93004
  const start = (code) => {
93005
- if (code !== codes.colon)
93005
+ if (code !== codes_codes.colon)
93006
93006
  return nok(code);
93007
93007
  effects.enter('gemoji');
93008
93008
  effects.enter('gemojiMarker');
@@ -93013,7 +93013,7 @@ function tokenize(effects, ok, nok) {
93013
93013
  };
93014
93014
  // First char after `:`, branch on `+` for :+1:, otherwise start normal name
93015
93015
  const nameStart = (code) => {
93016
- if (code === codes.plusSign) {
93016
+ if (code === codes_codes.plusSign) {
93017
93017
  effects.consume(code); // +
93018
93018
  return plusOne;
93019
93019
  }
@@ -93028,7 +93028,7 @@ function tokenize(effects, ok, nok) {
93028
93028
  // After `+`, only `1` is valid (for :+1:), anything else rejects
93029
93029
  // this is a special case for :+1: 👍 since + isnt a normal name character
93030
93030
  const plusOne = (code) => {
93031
- if (code === codes.digit1) {
93031
+ if (code === codes_codes.digit1) {
93032
93032
  hasName = true;
93033
93033
  effects.consume(code); // 1
93034
93034
  return nameEnd;
@@ -93037,7 +93037,7 @@ function tokenize(effects, ok, nok) {
93037
93037
  };
93038
93038
  // Consume name characters until we hit closing `:` or an invalid char
93039
93039
  const name = (code) => {
93040
- if (code === codes.colon) {
93040
+ if (code === codes_codes.colon) {
93041
93041
  if (!hasName)
93042
93042
  return nok(code);
93043
93043
  return nameEnd(code);
@@ -93051,7 +93051,7 @@ function tokenize(effects, ok, nok) {
93051
93051
  };
93052
93052
  // Expect closing `:`
93053
93053
  const nameEnd = (code) => {
93054
- if (code !== codes.colon)
93054
+ if (code !== codes_codes.colon)
93055
93055
  return nok(code);
93056
93056
  effects.exit('gemojiName');
93057
93057
  effects.enter('gemojiMarker');
@@ -93064,7 +93064,7 @@ function tokenize(effects, ok, nok) {
93064
93064
  }
93065
93065
  function syntax_gemoji() {
93066
93066
  return {
93067
- text: { [codes.colon]: gemojiConstruct },
93067
+ text: { [codes_codes.colon]: gemojiConstruct },
93068
93068
  };
93069
93069
  }
93070
93070
 
@@ -93079,8 +93079,8 @@ function syntax_gemoji() {
93079
93079
 
93080
93080
  function isAllowedValueChar(code) {
93081
93081
  return (code !== null &&
93082
- code !== codes.lessThan &&
93083
- code !== codes.greaterThan &&
93082
+ code !== codes_codes.lessThan &&
93083
+ code !== codes_codes.greaterThan &&
93084
93084
  !markdownLineEnding(code));
93085
93085
  }
93086
93086
  const legacyVariableConstruct = {
@@ -93090,7 +93090,7 @@ const legacyVariableConstruct = {
93090
93090
  function syntax_tokenize(effects, ok, nok) {
93091
93091
  let hasValue = false;
93092
93092
  const start = (code) => {
93093
- if (code !== codes.lessThan)
93093
+ if (code !== codes_codes.lessThan)
93094
93094
  return nok(code);
93095
93095
  effects.enter('legacyVariable');
93096
93096
  effects.enter('legacyVariableMarkerStart');
@@ -93098,7 +93098,7 @@ function syntax_tokenize(effects, ok, nok) {
93098
93098
  return open2;
93099
93099
  };
93100
93100
  const open2 = (code) => {
93101
- if (code !== codes.lessThan)
93101
+ if (code !== codes_codes.lessThan)
93102
93102
  return nok(code);
93103
93103
  effects.consume(code); // <<
93104
93104
  effects.exit('legacyVariableMarkerStart');
@@ -93106,7 +93106,7 @@ function syntax_tokenize(effects, ok, nok) {
93106
93106
  return value;
93107
93107
  };
93108
93108
  const value = (code) => {
93109
- if (code === codes.greaterThan) {
93109
+ if (code === codes_codes.greaterThan) {
93110
93110
  if (!hasValue)
93111
93111
  return nok(code);
93112
93112
  effects.exit('legacyVariableValue');
@@ -93121,7 +93121,7 @@ function syntax_tokenize(effects, ok, nok) {
93121
93121
  return value;
93122
93122
  };
93123
93123
  const close2 = (code) => {
93124
- if (code !== codes.greaterThan)
93124
+ if (code !== codes_codes.greaterThan)
93125
93125
  return nok(code);
93126
93126
  effects.consume(code); // >>
93127
93127
  effects.exit('legacyVariableMarkerEnd');
@@ -93132,7 +93132,7 @@ function syntax_tokenize(effects, ok, nok) {
93132
93132
  }
93133
93133
  function legacyVariable() {
93134
93134
  return {
93135
- text: { [codes.lessThan]: legacyVariableConstruct },
93135
+ text: { [codes_codes.lessThan]: legacyVariableConstruct },
93136
93136
  };
93137
93137
  }
93138
93138
 
@@ -95970,6 +95970,32 @@ const applyInserts = (html, inserts) => {
95970
95970
  return { value: out + html.slice(cursor), inserts: sorted };
95971
95971
  };
95972
95972
 
95973
+ ;// ./processor/transform/mdxish/tables/escape-stray-less-than.ts
95974
+
95975
+
95976
+ // A `<` only starts a JSX/HTML construct when followed by a tag-name start
95977
+ // (letter, `_`, `$`), a closer `/`, a fragment `>`, or a comment/declaration
95978
+ // `!`. Anything else (whitespace, EOL, a digit, …) is a literal `<` that acorn
95979
+ // rejects with "before name, expected a character that can start a name".
95980
+ const STRAY_LESS_THAN_RE = /<(?![a-zA-Z_$/>!])/g;
95981
+ /**
95982
+ * Escapes stray `<` characters that don't begin a valid tag so the strict mdxjs
95983
+ * parse treats them as literal text instead of throwing (`word <`, `a <1>`).
95984
+ *
95985
+ * Runs against the masked source so `<` inside code spans, legacy `<<var>>`
95986
+ * syntax, or already-escaped `\<` are left untouched.
95987
+ */
95988
+ const escapeStrayLessThan = (html) => {
95989
+ const masked = maskNonTagRegions(html);
95990
+ const inserts = [];
95991
+ STRAY_LESS_THAN_RE.lastIndex = 0;
95992
+ let match;
95993
+ while ((match = STRAY_LESS_THAN_RE.exec(masked)) !== null) {
95994
+ inserts.push({ offset: match.index, text: '\\' });
95995
+ }
95996
+ return applyInserts(html, inserts);
95997
+ };
95998
+
95973
95999
  ;// ./processor/transform/mdxish/tables/normalize-tag-spacing.ts
95974
96000
 
95975
96001
 
@@ -96469,6 +96495,7 @@ const repairUnclosedTags = (html) => {
96469
96495
 
96470
96496
 
96471
96497
 
96498
+
96472
96499
 
96473
96500
 
96474
96501
  const isTableCell = (node) => utils_isMDXElement(node) && ['th', 'td'].includes(node.name);
@@ -96755,11 +96782,14 @@ const mdxish_tables_mdxishTables = () => tree => {
96755
96782
  // - normalizeTagSpacing: a line mixing text and an opening tag
96756
96783
  // (e.g. `text <div> \n <div> text`)
96757
96784
  // - repairExpressionEscapes: backslash escapes inside a `{…}` expression
96785
+ // - escapeStrayLessThan: a `<` that doesn't begin a valid tag
96786
+ // (e.g. `word <`, `a <1>`)
96758
96787
  // These repairs are created after seeing real customer content that has failed to parse
96759
96788
  const repairs = [
96760
96789
  repairUnclosedTags,
96761
96790
  normalizeTagSpacing,
96762
96791
  repairExpressionEscapes,
96792
+ escapeStrayLessThan,
96763
96793
  ];
96764
96794
  // Stops at the first repair that yields a parseable tree
96765
96795
  repairs.some(repair => {
@@ -117498,6 +117528,21 @@ function isActualHtmlTag(tagName, originalExcerpt) {
117498
117528
  return true;
117499
117529
  return false;
117500
117530
  }
117531
+ /**
117532
+ * Re-parsing a component's text child treats it as a standalone document, so
117533
+ * content that happens to start with the literal word `export`/`import`
117534
+ * (e.g. link text like "export Lorem Ipsum") sits at true column 1 and
117535
+ * gets mistaken for an MDX ESM statement, which then fails to parse as JS.
117536
+ * Fall back to `undefined` rather than letting one such child crash the page.
117537
+ */
117538
+ function tryProcessMarkdown(processMarkdown, content) {
117539
+ try {
117540
+ return processMarkdown(content);
117541
+ }
117542
+ catch {
117543
+ return undefined;
117544
+ }
117545
+ }
117501
117546
  /** Parse and replace text children with processed markdown */
117502
117547
  function parseTextChildren(node, processMarkdown, components) {
117503
117548
  if (!node.children?.length)
@@ -117512,7 +117557,9 @@ function parseTextChildren(node, processMarkdown, components) {
117512
117557
  node.properties = { ...node.properties, children: child.value };
117513
117558
  return [];
117514
117559
  }
117515
- const hast = processMarkdown(child.value.trim());
117560
+ const hast = tryProcessMarkdown(processMarkdown, child.value.trim());
117561
+ if (!hast)
117562
+ return [child];
117516
117563
  const children = (hast.children ?? []).filter(isElementContentNode);
117517
117564
  // For inline components, preserve plain text instead of wrapping in <p>
117518
117565
  if (INLINE_COMPONENT_TAGS_LOWER.has(node.tagName.toLowerCase()) && isSingleParagraphTextNode(children)) {
@@ -117586,8 +117633,9 @@ const rehypeMdxishComponents = ({ components, processMarkdown }) => {
117586
117633
  // rehypeRaw strips children from <img> (void element), so we must
117587
117634
  // re-process the caption here, after rehypeRaw.
117588
117635
  if (node.tagName === 'img' && typeof node.properties?.caption === 'string' && !node.children?.length) {
117589
- const captionHast = processMarkdown(node.properties.caption);
117590
- node.children = (captionHast.children ?? []).filter(isElementContentNode);
117636
+ const caption = node.properties.caption;
117637
+ const captionHast = tryProcessMarkdown(processMarkdown, caption);
117638
+ node.children = captionHast ? (captionHast.children ?? []).filter(isElementContentNode) : [{ type: 'text', value: caption }];
117591
117639
  }
117592
117640
  // Skip runtime components and standard HTML tags
117593
117641
  if (RUNTIME_COMPONENT_TAGS.has(node.tagName))
@@ -118316,7 +118364,7 @@ const KNOWN_BLOCK_TYPES = new Set([
118316
118364
  * Types can contain alphanumeric characters and hyphens (e.g., "api-header", "tutorial-tile")
118317
118365
  */
118318
118366
  function isTypeChar(code) {
118319
- return asciiAlphanumeric(code) || code === codes.dash;
118367
+ return asciiAlphanumeric(code) || code === codes_codes.dash;
118320
118368
  }
118321
118369
  /**
118322
118370
  * Creates the opening marker state machine: [block:
@@ -118324,37 +118372,37 @@ function isTypeChar(code) {
118324
118372
  */
118325
118373
  function createOpeningMarkerParser(effects, nok, onComplete) {
118326
118374
  const expectB = (code) => {
118327
- if (code !== codes.lowercaseB)
118375
+ if (code !== codes_codes.lowercaseB)
118328
118376
  return nok(code);
118329
118377
  effects.consume(code);
118330
118378
  return expectL;
118331
118379
  };
118332
118380
  const expectL = (code) => {
118333
- if (code !== codes.lowercaseL)
118381
+ if (code !== codes_codes.lowercaseL)
118334
118382
  return nok(code);
118335
118383
  effects.consume(code);
118336
118384
  return expectO;
118337
118385
  };
118338
118386
  const expectO = (code) => {
118339
- if (code !== codes.lowercaseO)
118387
+ if (code !== codes_codes.lowercaseO)
118340
118388
  return nok(code);
118341
118389
  effects.consume(code);
118342
118390
  return expectC;
118343
118391
  };
118344
118392
  const expectC = (code) => {
118345
- if (code !== codes.lowercaseC)
118393
+ if (code !== codes_codes.lowercaseC)
118346
118394
  return nok(code);
118347
118395
  effects.consume(code);
118348
118396
  return expectK;
118349
118397
  };
118350
118398
  const expectK = (code) => {
118351
- if (code !== codes.lowercaseK)
118399
+ if (code !== codes_codes.lowercaseK)
118352
118400
  return nok(code);
118353
118401
  effects.consume(code);
118354
118402
  return expectColon;
118355
118403
  };
118356
118404
  const expectColon = (code) => {
118357
- if (code !== codes.colon)
118405
+ if (code !== codes_codes.colon)
118358
118406
  return nok(code);
118359
118407
  effects.consume(code);
118360
118408
  effects.exit('magicBlockMarkerStart');
@@ -118370,7 +118418,7 @@ function createOpeningMarkerParser(effects, nok, onComplete) {
118370
118418
  function createTypeCaptureParser(effects, nok, onComplete, blockTypeRef) {
118371
118419
  const captureTypeFirst = (code) => {
118372
118420
  // Reject empty type name [block:]
118373
- if (code === codes.rightSquareBracket) {
118421
+ if (code === codes_codes.rightSquareBracket) {
118374
118422
  return nok(code);
118375
118423
  }
118376
118424
  if (isTypeChar(code)) {
@@ -118381,7 +118429,7 @@ function createTypeCaptureParser(effects, nok, onComplete, blockTypeRef) {
118381
118429
  return nok(code);
118382
118430
  };
118383
118431
  const captureType = (code) => {
118384
- if (code === codes.rightSquareBracket) {
118432
+ if (code === codes_codes.rightSquareBracket) {
118385
118433
  if (!KNOWN_BLOCK_TYPES.has(blockTypeRef.value)) {
118386
118434
  return nok(code);
118387
118435
  }
@@ -118406,7 +118454,7 @@ function createTypeCaptureParser(effects, nok, onComplete, blockTypeRef) {
118406
118454
  */
118407
118455
  function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonState) {
118408
118456
  const handleMismatch = (code) => {
118409
- if (jsonState && code === codes.quotationMark) {
118457
+ if (jsonState && code === codes_codes.quotationMark) {
118410
118458
  jsonState.inString = true;
118411
118459
  }
118412
118460
  return onMismatch(code);
@@ -118414,7 +118462,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118414
118462
  const expectSlash = (code) => {
118415
118463
  if (code === null)
118416
118464
  return onEof(code);
118417
- if (code !== codes.slash)
118465
+ if (code !== codes_codes.slash)
118418
118466
  return handleMismatch(code);
118419
118467
  effects.consume(code);
118420
118468
  return expectB;
@@ -118422,7 +118470,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118422
118470
  const expectB = (code) => {
118423
118471
  if (code === null)
118424
118472
  return onEof(code);
118425
- if (code !== codes.lowercaseB)
118473
+ if (code !== codes_codes.lowercaseB)
118426
118474
  return handleMismatch(code);
118427
118475
  effects.consume(code);
118428
118476
  return expectL;
@@ -118430,7 +118478,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118430
118478
  const expectL = (code) => {
118431
118479
  if (code === null)
118432
118480
  return onEof(code);
118433
- if (code !== codes.lowercaseL)
118481
+ if (code !== codes_codes.lowercaseL)
118434
118482
  return handleMismatch(code);
118435
118483
  effects.consume(code);
118436
118484
  return expectO;
@@ -118438,7 +118486,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118438
118486
  const expectO = (code) => {
118439
118487
  if (code === null)
118440
118488
  return onEof(code);
118441
- if (code !== codes.lowercaseO)
118489
+ if (code !== codes_codes.lowercaseO)
118442
118490
  return handleMismatch(code);
118443
118491
  effects.consume(code);
118444
118492
  return expectC;
@@ -118446,7 +118494,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118446
118494
  const expectC = (code) => {
118447
118495
  if (code === null)
118448
118496
  return onEof(code);
118449
- if (code !== codes.lowercaseC)
118497
+ if (code !== codes_codes.lowercaseC)
118450
118498
  return handleMismatch(code);
118451
118499
  effects.consume(code);
118452
118500
  return expectK;
@@ -118454,7 +118502,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118454
118502
  const expectK = (code) => {
118455
118503
  if (code === null)
118456
118504
  return onEof(code);
118457
- if (code !== codes.lowercaseK)
118505
+ if (code !== codes_codes.lowercaseK)
118458
118506
  return handleMismatch(code);
118459
118507
  effects.consume(code);
118460
118508
  return expectBracket;
@@ -118462,7 +118510,7 @@ function createClosingMarkerParser(effects, onSuccess, onMismatch, onEof, jsonSt
118462
118510
  const expectBracket = (code) => {
118463
118511
  if (code === null)
118464
118512
  return onEof(code);
118465
- if (code !== codes.rightSquareBracket)
118513
+ if (code !== codes_codes.rightSquareBracket)
118466
118514
  return handleMismatch(code);
118467
118515
  effects.consume(code);
118468
118516
  return onSuccess;
@@ -118518,7 +118566,7 @@ function syntax_magicBlock() {
118518
118566
  // Flow construct - handles block-level magic blocks at document root
118519
118567
  // Marked as concrete to prevent interruption by containers
118520
118568
  flow: {
118521
- [codes.leftSquareBracket]: {
118569
+ [codes_codes.leftSquareBracket]: {
118522
118570
  name: 'magicBlock',
118523
118571
  concrete: true,
118524
118572
  tokenize: tokenizeMagicBlockFlow,
@@ -118526,7 +118574,7 @@ function syntax_magicBlock() {
118526
118574
  },
118527
118575
  // Text construct - handles magic blocks in inline contexts (lists, paragraphs)
118528
118576
  text: {
118529
- [codes.leftSquareBracket]: {
118577
+ [codes_codes.leftSquareBracket]: {
118530
118578
  name: 'magicBlock',
118531
118579
  tokenize: tokenizeMagicBlockText,
118532
118580
  },
@@ -118547,7 +118595,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118547
118595
  const openingMarkerParser = createOpeningMarkerParser(effects, nok, typeParser.first);
118548
118596
  return start;
118549
118597
  function start(code) {
118550
- if (code !== codes.leftSquareBracket)
118598
+ if (code !== codes_codes.leftSquareBracket)
118551
118599
  return nok(code);
118552
118600
  effects.enter('magicBlock');
118553
118601
  effects.enter('magicBlockMarkerStart');
@@ -118570,7 +118618,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118570
118618
  // Check for closing marker directly (without entering data)
118571
118619
  // This handles cases like [block:type]\n{}\n\n[/block] where there are
118572
118620
  // newlines after the data object
118573
- if (code === codes.leftSquareBracket) {
118621
+ if (code === codes_codes.leftSquareBracket) {
118574
118622
  effects.enter('magicBlockMarkerEnd');
118575
118623
  effects.consume(code);
118576
118624
  return expectSlashFromContinuation;
@@ -118582,11 +118630,11 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118582
118630
  }
118583
118631
  // Skip whitespace (spaces/tabs) before the data - stay in beforeData
118584
118632
  // Don't enter magicBlockData token yet until we confirm there's a '{'
118585
- if (code === codes.space || code === codes.horizontalTab) {
118633
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
118586
118634
  return beforeDataWhitespace(code);
118587
118635
  }
118588
118636
  // Data must start with '{' for valid JSON
118589
- if (code !== codes.leftCurlyBrace) {
118637
+ if (code !== codes_codes.leftCurlyBrace) {
118590
118638
  effects.exit('magicBlock');
118591
118639
  return nok(code);
118592
118640
  }
@@ -118607,14 +118655,14 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118607
118655
  if (markdownLineEnding(code)) {
118608
118656
  return effects.check(syntax_nonLazyContinuation, continuationOkBeforeData, after)(code);
118609
118657
  }
118610
- if (code === codes.space || code === codes.horizontalTab) {
118658
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
118611
118659
  // We need to consume this but can't without a token - use magicBlockData
118612
118660
  // and track that we haven't seen '{' yet
118613
118661
  effects.enter('magicBlockData');
118614
118662
  effects.consume(code);
118615
118663
  return beforeDataWhitespaceContinue;
118616
118664
  }
118617
- if (code === codes.leftCurlyBrace) {
118665
+ if (code === codes_codes.leftCurlyBrace) {
118618
118666
  seenOpenBrace = true;
118619
118667
  effects.enter('magicBlockData');
118620
118668
  return captureData(code);
@@ -118635,11 +118683,11 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118635
118683
  effects.exit('magicBlockData');
118636
118684
  return effects.check(syntax_nonLazyContinuation, continuationOk, after)(code);
118637
118685
  }
118638
- if (code === codes.space || code === codes.horizontalTab) {
118686
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
118639
118687
  effects.consume(code);
118640
118688
  return beforeDataWhitespaceContinue;
118641
118689
  }
118642
- if (code === codes.leftCurlyBrace) {
118690
+ if (code === codes_codes.leftCurlyBrace) {
118643
118691
  seenOpenBrace = true;
118644
118692
  return captureData(code);
118645
118693
  }
@@ -118674,23 +118722,23 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118674
118722
  return captureData;
118675
118723
  }
118676
118724
  if (jsonState.inString) {
118677
- if (code === codes.backslash) {
118725
+ if (code === codes_codes.backslash) {
118678
118726
  jsonState.escapeNext = true;
118679
118727
  effects.consume(code);
118680
118728
  return captureData;
118681
118729
  }
118682
- if (code === codes.quotationMark) {
118730
+ if (code === codes_codes.quotationMark) {
118683
118731
  jsonState.inString = false;
118684
118732
  }
118685
118733
  effects.consume(code);
118686
118734
  return captureData;
118687
118735
  }
118688
- if (code === codes.quotationMark) {
118736
+ if (code === codes_codes.quotationMark) {
118689
118737
  jsonState.inString = true;
118690
118738
  effects.consume(code);
118691
118739
  return captureData;
118692
118740
  }
118693
- if (code === codes.leftSquareBracket) {
118741
+ if (code === codes_codes.leftSquareBracket) {
118694
118742
  effects.exit('magicBlockData');
118695
118743
  effects.enter('magicBlockMarkerEnd');
118696
118744
  effects.consume(code);
@@ -118723,7 +118771,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118723
118771
  }
118724
118772
  // Check if this is the start of the closing marker [/block]
118725
118773
  // If so, handle it directly without entering magicBlockData
118726
- if (code === codes.leftSquareBracket) {
118774
+ if (code === codes_codes.leftSquareBracket) {
118727
118775
  effects.enter('magicBlockMarkerEnd');
118728
118776
  effects.consume(code);
118729
118777
  return expectSlashFromContinuation;
@@ -118745,7 +118793,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118745
118793
  effects.exit('magicBlockMarkerEnd');
118746
118794
  return effects.check(syntax_nonLazyContinuation, continuationOkBeforeData, after)(code);
118747
118795
  }
118748
- if (code === codes.slash) {
118796
+ if (code === codes_codes.slash) {
118749
118797
  effects.consume(code);
118750
118798
  return expectClosingB;
118751
118799
  }
@@ -118756,7 +118804,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118756
118804
  // The [ was consumed by the marker, so we need to conceptually "have it" in our data
118757
118805
  // But since we already consumed it into the marker, we need a different approach
118758
118806
  // Re-classify: consume this character as data and continue
118759
- if (code === codes.quotationMark)
118807
+ if (code === codes_codes.quotationMark)
118760
118808
  jsonState.inString = true;
118761
118809
  effects.consume(code);
118762
118810
  return captureData;
@@ -118772,10 +118820,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118772
118820
  effects.exit('magicBlockMarkerEnd');
118773
118821
  return effects.check(syntax_nonLazyContinuation, continuationOk, after)(code);
118774
118822
  }
118775
- if (code !== codes.slash) {
118823
+ if (code !== codes_codes.slash) {
118776
118824
  effects.exit('magicBlockMarkerEnd');
118777
118825
  effects.enter('magicBlockData');
118778
- if (code === codes.quotationMark)
118826
+ if (code === codes_codes.quotationMark)
118779
118827
  jsonState.inString = true;
118780
118828
  effects.consume(code);
118781
118829
  return captureData;
@@ -118789,10 +118837,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118789
118837
  effects.exit('magicBlock');
118790
118838
  return nok(code);
118791
118839
  }
118792
- if (code !== codes.lowercaseB) {
118840
+ if (code !== codes_codes.lowercaseB) {
118793
118841
  effects.exit('magicBlockMarkerEnd');
118794
118842
  effects.enter('magicBlockData');
118795
- if (code === codes.quotationMark)
118843
+ if (code === codes_codes.quotationMark)
118796
118844
  jsonState.inString = true;
118797
118845
  effects.consume(code);
118798
118846
  return captureData;
@@ -118806,10 +118854,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118806
118854
  effects.exit('magicBlock');
118807
118855
  return nok(code);
118808
118856
  }
118809
- if (code !== codes.lowercaseL) {
118857
+ if (code !== codes_codes.lowercaseL) {
118810
118858
  effects.exit('magicBlockMarkerEnd');
118811
118859
  effects.enter('magicBlockData');
118812
- if (code === codes.quotationMark)
118860
+ if (code === codes_codes.quotationMark)
118813
118861
  jsonState.inString = true;
118814
118862
  effects.consume(code);
118815
118863
  return captureData;
@@ -118823,10 +118871,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118823
118871
  effects.exit('magicBlock');
118824
118872
  return nok(code);
118825
118873
  }
118826
- if (code !== codes.lowercaseO) {
118874
+ if (code !== codes_codes.lowercaseO) {
118827
118875
  effects.exit('magicBlockMarkerEnd');
118828
118876
  effects.enter('magicBlockData');
118829
- if (code === codes.quotationMark)
118877
+ if (code === codes_codes.quotationMark)
118830
118878
  jsonState.inString = true;
118831
118879
  effects.consume(code);
118832
118880
  return captureData;
@@ -118840,10 +118888,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118840
118888
  effects.exit('magicBlock');
118841
118889
  return nok(code);
118842
118890
  }
118843
- if (code !== codes.lowercaseC) {
118891
+ if (code !== codes_codes.lowercaseC) {
118844
118892
  effects.exit('magicBlockMarkerEnd');
118845
118893
  effects.enter('magicBlockData');
118846
- if (code === codes.quotationMark)
118894
+ if (code === codes_codes.quotationMark)
118847
118895
  jsonState.inString = true;
118848
118896
  effects.consume(code);
118849
118897
  return captureData;
@@ -118857,10 +118905,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118857
118905
  effects.exit('magicBlock');
118858
118906
  return nok(code);
118859
118907
  }
118860
- if (code !== codes.lowercaseK) {
118908
+ if (code !== codes_codes.lowercaseK) {
118861
118909
  effects.exit('magicBlockMarkerEnd');
118862
118910
  effects.enter('magicBlockData');
118863
- if (code === codes.quotationMark)
118911
+ if (code === codes_codes.quotationMark)
118864
118912
  jsonState.inString = true;
118865
118913
  effects.consume(code);
118866
118914
  return captureData;
@@ -118874,10 +118922,10 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118874
118922
  effects.exit('magicBlock');
118875
118923
  return nok(code);
118876
118924
  }
118877
- if (code !== codes.rightSquareBracket) {
118925
+ if (code !== codes_codes.rightSquareBracket) {
118878
118926
  effects.exit('magicBlockMarkerEnd');
118879
118927
  effects.enter('magicBlockData');
118880
- if (code === codes.quotationMark)
118928
+ if (code === codes_codes.quotationMark)
118881
118929
  jsonState.inString = true;
118882
118930
  effects.consume(code);
118883
118931
  return captureData;
@@ -118904,7 +118952,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118904
118952
  return ok(code);
118905
118953
  }
118906
118954
  // Space or tab - consume as trailing whitespace
118907
- if (code === codes.space || code === codes.horizontalTab) {
118955
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
118908
118956
  effects.enter('magicBlockTrailing');
118909
118957
  effects.consume(code);
118910
118958
  return consumeTrailingContinue;
@@ -118930,7 +118978,7 @@ function tokenizeMagicBlockFlow(effects, ok, nok) {
118930
118978
  return ok(code);
118931
118979
  }
118932
118980
  // More space or tab - keep consuming
118933
- if (code === codes.space || code === codes.horizontalTab) {
118981
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
118934
118982
  effects.consume(code);
118935
118983
  return consumeTrailingContinue;
118936
118984
  }
@@ -118970,7 +119018,7 @@ function tokenizeMagicBlockText(effects, ok, nok) {
118970
119018
  const closingMismatch = (code) => {
118971
119019
  effects.exit('magicBlockMarkerEnd');
118972
119020
  effects.enter('magicBlockData');
118973
- if (code === codes.quotationMark)
119021
+ if (code === codes_codes.quotationMark)
118974
119022
  jsonState.inString = true;
118975
119023
  effects.consume(code);
118976
119024
  return captureData;
@@ -118982,7 +119030,7 @@ function tokenizeMagicBlockText(effects, ok, nok) {
118982
119030
  const closingFromData = createClosingMarkerParser(effects, closingSuccess, closingMismatch, closingEof, jsonState);
118983
119031
  return start;
118984
119032
  function start(code) {
118985
- if (code !== codes.leftSquareBracket)
119033
+ if (code !== codes_codes.leftSquareBracket)
118986
119034
  return nok(code);
118987
119035
  effects.enter('magicBlock');
118988
119036
  effects.enter('magicBlockMarkerStart');
@@ -119006,7 +119054,7 @@ function tokenizeMagicBlockText(effects, ok, nok) {
119006
119054
  return beforeData;
119007
119055
  }
119008
119056
  // Check for closing marker directly (without entering data)
119009
- if (code === codes.leftSquareBracket) {
119057
+ if (code === codes_codes.leftSquareBracket) {
119010
119058
  effects.enter('magicBlockMarkerEnd');
119011
119059
  effects.consume(code);
119012
119060
  return closingFromBeforeData.expectSlash;
@@ -119017,11 +119065,11 @@ function tokenizeMagicBlockText(effects, ok, nok) {
119017
119065
  return captureData(code);
119018
119066
  }
119019
119067
  // Skip whitespace (spaces/tabs) before the data
119020
- if (code === codes.space || code === codes.horizontalTab) {
119068
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
119021
119069
  return beforeDataWhitespace(code);
119022
119070
  }
119023
119071
  // Data must start with '{' for valid JSON
119024
- if (code !== codes.leftCurlyBrace) {
119072
+ if (code !== codes_codes.leftCurlyBrace) {
119025
119073
  return nok(code);
119026
119074
  }
119027
119075
  // We have '{' - enter data token and start capturing
@@ -119042,12 +119090,12 @@ function tokenizeMagicBlockText(effects, ok, nok) {
119042
119090
  effects.exit('magicBlockLineEnding');
119043
119091
  return beforeData;
119044
119092
  }
119045
- if (code === codes.space || code === codes.horizontalTab) {
119093
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
119046
119094
  effects.enter('magicBlockData');
119047
119095
  effects.consume(code);
119048
119096
  return beforeDataWhitespaceContinue;
119049
119097
  }
119050
- if (code === codes.leftCurlyBrace) {
119098
+ if (code === codes_codes.leftCurlyBrace) {
119051
119099
  seenOpenBrace = true;
119052
119100
  effects.enter('magicBlockData');
119053
119101
  return captureData(code);
@@ -119069,11 +119117,11 @@ function tokenizeMagicBlockText(effects, ok, nok) {
119069
119117
  effects.exit('magicBlockLineEnding');
119070
119118
  return beforeData;
119071
119119
  }
119072
- if (code === codes.space || code === codes.horizontalTab) {
119120
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
119073
119121
  effects.consume(code);
119074
119122
  return beforeDataWhitespaceContinue;
119075
119123
  }
119076
- if (code === codes.leftCurlyBrace) {
119124
+ if (code === codes_codes.leftCurlyBrace) {
119077
119125
  seenOpenBrace = true;
119078
119126
  return captureData(code);
119079
119127
  }
@@ -119101,23 +119149,23 @@ function tokenizeMagicBlockText(effects, ok, nok) {
119101
119149
  return captureData;
119102
119150
  }
119103
119151
  if (jsonState.inString) {
119104
- if (code === codes.backslash) {
119152
+ if (code === codes_codes.backslash) {
119105
119153
  jsonState.escapeNext = true;
119106
119154
  effects.consume(code);
119107
119155
  return captureData;
119108
119156
  }
119109
- if (code === codes.quotationMark) {
119157
+ if (code === codes_codes.quotationMark) {
119110
119158
  jsonState.inString = false;
119111
119159
  }
119112
119160
  effects.consume(code);
119113
119161
  return captureData;
119114
119162
  }
119115
- if (code === codes.quotationMark) {
119163
+ if (code === codes_codes.quotationMark) {
119116
119164
  jsonState.inString = true;
119117
119165
  effects.consume(code);
119118
119166
  return captureData;
119119
119167
  }
119120
- if (code === codes.leftSquareBracket) {
119168
+ if (code === codes_codes.leftSquareBracket) {
119121
119169
  effects.exit('magicBlockData');
119122
119170
  effects.enter('magicBlockMarkerEnd');
119123
119171
  effects.consume(code);
@@ -119708,11 +119756,11 @@ function createTokenize(mode) {
119708
119756
  // When a } brings braceDepth back to a saved value, we return to the
119709
119757
  // template literal instead of continuing in the brace expression.
119710
119758
  const templateStack = [];
119711
- const isAlpha = (code) => (code >= codes.uppercaseA && code <= codes.uppercaseZ) ||
119712
- (code >= codes.lowercaseA && code <= codes.lowercaseZ);
119759
+ const isAlpha = (code) => (code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) ||
119760
+ (code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ);
119713
119761
  const isSameCaseAsTag = (code) => isLowercaseTag
119714
- ? code >= codes.lowercaseA && code <= codes.lowercaseZ
119715
- : code >= codes.uppercaseA && code <= codes.uppercaseZ;
119762
+ ? code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ
119763
+ : code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ;
119716
119764
  // Shared brace-expression state machine. The two call sites differ only in where
119717
119765
  // to continue after a line ending and where to return when braceDepth reaches zero.
119718
119766
  function createBraceExprStates(continuationStart, afterBraceClose) {
@@ -119725,22 +119773,22 @@ function createTokenize(mode) {
119725
119773
  effects.exit('mdxComponentData');
119726
119774
  return continuationStart(code);
119727
119775
  }
119728
- if (code === codes.quotationMark || code === codes.apostrophe) {
119776
+ if (code === codes_codes.quotationMark || code === codes_codes.apostrophe) {
119729
119777
  quoteChar = code;
119730
119778
  effects.consume(code);
119731
119779
  return braceString;
119732
119780
  }
119733
- if (code === codes.graveAccent) {
119781
+ if (code === codes_codes.graveAccent) {
119734
119782
  inTemplateLit = true;
119735
119783
  effects.consume(code);
119736
119784
  return braceTemplateLiteral;
119737
119785
  }
119738
- if (code === codes.leftCurlyBrace) {
119786
+ if (code === codes_codes.leftCurlyBrace) {
119739
119787
  braceDepth += 1;
119740
119788
  effects.consume(code);
119741
119789
  return braceExpr;
119742
119790
  }
119743
- if (code === codes.rightCurlyBrace) {
119791
+ if (code === codes_codes.rightCurlyBrace) {
119744
119792
  braceDepth -= 1;
119745
119793
  effects.consume(code);
119746
119794
  if (templateStack.length > 0 && braceDepth === templateStack[templateStack.length - 1]) {
@@ -119765,7 +119813,7 @@ function createTokenize(mode) {
119765
119813
  effects.exit('mdxComponentData');
119766
119814
  return continuationStart(code);
119767
119815
  }
119768
- if (code === codes.backslash) {
119816
+ if (code === codes_codes.backslash) {
119769
119817
  effects.consume(code);
119770
119818
  return braceStringEscape;
119771
119819
  }
@@ -119793,16 +119841,16 @@ function createTokenize(mode) {
119793
119841
  effects.exit('mdxComponentData');
119794
119842
  return continuationStart(code);
119795
119843
  }
119796
- if (code === codes.graveAccent) {
119844
+ if (code === codes_codes.graveAccent) {
119797
119845
  inTemplateLit = false;
119798
119846
  effects.consume(code);
119799
119847
  return braceExpr;
119800
119848
  }
119801
- if (code === codes.backslash) {
119849
+ if (code === codes_codes.backslash) {
119802
119850
  effects.consume(code);
119803
119851
  return braceTemplateLiteralEscape;
119804
119852
  }
119805
- if (code === codes.dollarSign) {
119853
+ if (code === codes_codes.dollarSign) {
119806
119854
  effects.consume(code);
119807
119855
  return braceTemplateLiteralDollar;
119808
119856
  }
@@ -119817,7 +119865,7 @@ function createTokenize(mode) {
119817
119865
  return braceTemplateLiteral;
119818
119866
  }
119819
119867
  function braceTemplateLiteralDollar(code) {
119820
- if (code === codes.leftCurlyBrace) {
119868
+ if (code === codes_codes.leftCurlyBrace) {
119821
119869
  templateStack.push(braceDepth);
119822
119870
  braceDepth += 1;
119823
119871
  inTemplateLit = false;
@@ -119833,7 +119881,7 @@ function createTokenize(mode) {
119833
119881
  return start;
119834
119882
  // ── Start ──────────────────────────────────────────────────────────────
119835
119883
  function start(code) {
119836
- if (code !== codes.lessThan)
119884
+ if (code !== codes_codes.lessThan)
119837
119885
  return nok(code);
119838
119886
  effects.enter('mdxComponent');
119839
119887
  effects.enter('mdxComponentData');
@@ -119845,7 +119893,7 @@ function createTokenize(mode) {
119845
119893
  // Uppercase A-Z → PascalCase MDX component. Flow mode claims block
119846
119894
  // components; text mode only claims inline components (Anchor, Glossary),
119847
119895
  // which is enforced once the full name is known in `tagNameRest`.
119848
- if (code !== null && code >= codes.uppercaseA && code <= codes.uppercaseZ) {
119896
+ if (code !== null && code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) {
119849
119897
  tagName = String.fromCharCode(code);
119850
119898
  isLowercaseTag = false;
119851
119899
  sawBraceAttr = false;
@@ -119855,7 +119903,7 @@ function createTokenize(mode) {
119855
119903
  // Lowercase a-z → HTML tag (claim only if `{...}` attr appears). In
119856
119904
  // flow mode, refuse to interrupt a paragraph — same rule as html-flow
119857
119905
  // type-7. The text variant picks these up during inline parsing.
119858
- if (code !== null && code >= codes.lowercaseA && code <= codes.lowercaseZ) {
119906
+ if (code !== null && code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ) {
119859
119907
  if (isFlow && self.interrupt)
119860
119908
  return nok(code);
119861
119909
  tagName = String.fromCharCode(code);
@@ -119868,10 +119916,10 @@ function createTokenize(mode) {
119868
119916
  }
119869
119917
  function tagNameRest(code) {
119870
119918
  if (code !== null &&
119871
- ((code >= codes.uppercaseA && code <= codes.uppercaseZ) ||
119872
- (code >= codes.lowercaseA && code <= codes.lowercaseZ) ||
119873
- (code >= codes.digit0 && code <= codes.digit9) ||
119874
- code === codes.underscore)) {
119919
+ ((code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) ||
119920
+ (code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ) ||
119921
+ (code >= codes_codes.digit0 && code <= codes_codes.digit9) ||
119922
+ code === codes_codes.underscore)) {
119875
119923
  tagName += String.fromCharCode(code);
119876
119924
  effects.consume(code);
119877
119925
  return tagNameRest;
@@ -119906,14 +119954,14 @@ function createTokenize(mode) {
119906
119954
  return openTagContinuationStart(code);
119907
119955
  }
119908
119956
  // Self-closing />
119909
- if (code === codes.slash) {
119957
+ if (code === codes_codes.slash) {
119910
119958
  if (requiresBraceAttr && !sawBraceAttr)
119911
119959
  return nok(code);
119912
119960
  effects.consume(code);
119913
119961
  return selfCloseGt;
119914
119962
  }
119915
119963
  // End of opening tag
119916
- if (code === codes.greaterThan) {
119964
+ if (code === codes_codes.greaterThan) {
119917
119965
  if (requiresBraceAttr && !sawBraceAttr) {
119918
119966
  // Plain lowercase block tags stay claimable in flow, gated per line by
119919
119967
  // `plainClaimLineStart`; everything else falls through to CommonMark.
@@ -119926,13 +119974,13 @@ function createTokenize(mode) {
119926
119974
  return body;
119927
119975
  }
119928
119976
  // Quoted attribute value
119929
- if (code === codes.quotationMark || code === codes.apostrophe) {
119977
+ if (code === codes_codes.quotationMark || code === codes_codes.apostrophe) {
119930
119978
  quoteChar = code;
119931
119979
  effects.consume(code);
119932
119980
  return inQuotedAttr;
119933
119981
  }
119934
119982
  // JSX expression attribute
119935
- if (code === codes.leftCurlyBrace) {
119983
+ if (code === codes_codes.leftCurlyBrace) {
119936
119984
  braceDepth = 1;
119937
119985
  sawBraceAttr = true;
119938
119986
  effects.consume(code);
@@ -119950,7 +119998,7 @@ function createTokenize(mode) {
119950
119998
  effects.exit('mdxComponentData');
119951
119999
  return openTagContinuationStart(code);
119952
120000
  }
119953
- if (code === codes.backslash) {
120001
+ if (code === codes_codes.backslash) {
119954
120002
  effects.consume(code);
119955
120003
  return inQuotedAttrEscape;
119956
120004
  }
@@ -119970,7 +120018,7 @@ function createTokenize(mode) {
119970
120018
  return inQuotedAttr;
119971
120019
  }
119972
120020
  function selfCloseGt(code) {
119973
- if (code === codes.greaterThan) {
120021
+ if (code === codes_codes.greaterThan) {
119974
120022
  effects.consume(code);
119975
120023
  // Self-closing tag completes the token
119976
120024
  return afterClose;
@@ -120023,25 +120071,25 @@ function createTokenize(mode) {
120023
120071
  atLineStart = true;
120024
120072
  return bodyContinuationStart(code);
120025
120073
  }
120026
- if (code !== codes.space && code !== codes.horizontalTab) {
120074
+ if (code !== codes_codes.space && code !== codes_codes.horizontalTab) {
120027
120075
  openerLineHasContent = true;
120028
120076
  }
120029
- if (code === codes.backslash) {
120077
+ if (code === codes_codes.backslash) {
120030
120078
  effects.consume(code);
120031
120079
  return bodyEscapedChar;
120032
120080
  }
120033
- if (code === codes.lessThan) {
120081
+ if (code === codes_codes.lessThan) {
120034
120082
  effects.consume(code);
120035
120083
  return bodyLessThan;
120036
120084
  }
120037
120085
  // Code span tracking
120038
- if (code === codes.graveAccent) {
120086
+ if (code === codes_codes.graveAccent) {
120039
120087
  codeSpanOpenSize = 0;
120040
120088
  return countOpenTicks(code);
120041
120089
  }
120042
120090
  // JSX expression child — track braces/template literals so the closing
120043
120091
  // backtick of `{`...`}` is not misread as a code span opener
120044
- if (code === codes.leftCurlyBrace) {
120092
+ if (code === codes_codes.leftCurlyBrace) {
120045
120093
  braceDepth = 1;
120046
120094
  inTemplateLit = false;
120047
120095
  effects.consume(code);
@@ -120061,14 +120109,14 @@ function createTokenize(mode) {
120061
120109
  }
120062
120110
  // ── Code span handling ─────────────────────────────────────────────────
120063
120111
  function countOpenTicks(code) {
120064
- if (code === codes.graveAccent) {
120112
+ if (code === codes_codes.graveAccent) {
120065
120113
  codeSpanOpenSize += 1;
120066
120114
  effects.consume(code);
120067
120115
  return countOpenTicks;
120068
120116
  }
120069
120117
  // 3+ backticks at line start = fenced code block
120070
120118
  if (atLineStart && codeSpanOpenSize >= 3) {
120071
- fenceChar = codes.graveAccent;
120119
+ fenceChar = codes_codes.graveAccent;
120072
120120
  fenceLength = codeSpanOpenSize;
120073
120121
  atLineStart = false;
120074
120122
  return inFencedCode(code);
@@ -120078,7 +120126,7 @@ function createTokenize(mode) {
120078
120126
  function inCodeSpan(code) {
120079
120127
  if (code === null || markdownLineEnding(code))
120080
120128
  return body(code);
120081
- if (code === codes.graveAccent) {
120129
+ if (code === codes_codes.graveAccent) {
120082
120130
  codeSpanCloseSize = 0;
120083
120131
  return countCloseTicks(code);
120084
120132
  }
@@ -120086,7 +120134,7 @@ function createTokenize(mode) {
120086
120134
  return inCodeSpan;
120087
120135
  }
120088
120136
  function countCloseTicks(code) {
120089
- if (code === codes.graveAccent) {
120137
+ if (code === codes_codes.graveAccent) {
120090
120138
  codeSpanCloseSize += 1;
120091
120139
  effects.consume(code);
120092
120140
  return countCloseTicks;
@@ -120149,7 +120197,7 @@ function createTokenize(mode) {
120149
120197
  return body(code);
120150
120198
  }
120151
120199
  // Only spaces/tabs allowed after closing fence
120152
- if (code === codes.space || code === codes.horizontalTab) {
120200
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
120153
120201
  effects.consume(code);
120154
120202
  return fenceCloseTrailing;
120155
120203
  }
@@ -120158,7 +120206,7 @@ function createTokenize(mode) {
120158
120206
  }
120159
120207
  // ── Tilde fenced code detection ────────────────────────────────────────
120160
120208
  function bodyAfterLineStart(code) {
120161
- if (code === codes.tilde) {
120209
+ if (code === codes_codes.tilde) {
120162
120210
  fenceCloseLength = 1;
120163
120211
  effects.consume(code);
120164
120212
  return countTildes;
@@ -120167,13 +120215,13 @@ function createTokenize(mode) {
120167
120215
  return body(code);
120168
120216
  }
120169
120217
  function countTildes(code) {
120170
- if (code === codes.tilde) {
120218
+ if (code === codes_codes.tilde) {
120171
120219
  fenceCloseLength += 1;
120172
120220
  effects.consume(code);
120173
120221
  return countTildes;
120174
120222
  }
120175
120223
  if (fenceCloseLength >= 3) {
120176
- fenceChar = codes.tilde;
120224
+ fenceChar = codes_codes.tilde;
120177
120225
  fenceLength = fenceCloseLength;
120178
120226
  return inFencedCode(code);
120179
120227
  }
@@ -120183,7 +120231,7 @@ function createTokenize(mode) {
120183
120231
  }
120184
120232
  // ── Tag detection inside body ──────────────────────────────────────────
120185
120233
  function bodyLessThan(code) {
120186
- if (code === codes.slash) {
120234
+ if (code === codes_codes.slash) {
120187
120235
  if (onOpenerLine)
120188
120236
  openerLineCloses += 1;
120189
120237
  effects.consume(code);
@@ -120210,10 +120258,10 @@ function createTokenize(mode) {
120210
120258
  // ── Nested opening tag ─────────────────────────────────────────────────
120211
120259
  function nestedOpenTagName(code) {
120212
120260
  if (code !== null &&
120213
- ((code >= codes.uppercaseA && code <= codes.uppercaseZ) ||
120214
- (code >= codes.lowercaseA && code <= codes.lowercaseZ) ||
120215
- (code >= codes.digit0 && code <= codes.digit9) ||
120216
- code === codes.underscore)) {
120261
+ ((code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) ||
120262
+ (code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ) ||
120263
+ (code >= codes_codes.digit0 && code <= codes_codes.digit9) ||
120264
+ code === codes_codes.underscore)) {
120217
120265
  closingTagName += String.fromCharCode(code);
120218
120266
  effects.consume(code);
120219
120267
  return nestedOpenTagName;
@@ -120221,10 +120269,10 @@ function createTokenize(mode) {
120221
120269
  // Same-name opener followed by a tag-end char bumps depth. A line ending
120222
120270
  // counts too: Prettier puts a newline right after the name (`<div\n …\n>`).
120223
120271
  if (closingTagName === tagName &&
120224
- (code === codes.greaterThan ||
120225
- code === codes.slash ||
120226
- code === codes.space ||
120227
- code === codes.horizontalTab ||
120272
+ (code === codes_codes.greaterThan ||
120273
+ code === codes_codes.slash ||
120274
+ code === codes_codes.space ||
120275
+ code === codes_codes.horizontalTab ||
120228
120276
  markdownLineEnding(code))) {
120229
120277
  depth += 1;
120230
120278
  }
@@ -120243,15 +120291,15 @@ function createTokenize(mode) {
120243
120291
  }
120244
120292
  function closingTagNameRest(code) {
120245
120293
  if (code !== null &&
120246
- ((code >= codes.uppercaseA && code <= codes.uppercaseZ) ||
120247
- (code >= codes.lowercaseA && code <= codes.lowercaseZ) ||
120248
- (code >= codes.digit0 && code <= codes.digit9) ||
120249
- code === codes.underscore)) {
120294
+ ((code >= codes_codes.uppercaseA && code <= codes_codes.uppercaseZ) ||
120295
+ (code >= codes_codes.lowercaseA && code <= codes_codes.lowercaseZ) ||
120296
+ (code >= codes_codes.digit0 && code <= codes_codes.digit9) ||
120297
+ code === codes_codes.underscore)) {
120250
120298
  closingTagName += String.fromCharCode(code);
120251
120299
  effects.consume(code);
120252
120300
  return closingTagNameRest;
120253
120301
  }
120254
- if (closingTagName === tagName && code === codes.greaterThan) {
120302
+ if (closingTagName === tagName && code === codes_codes.greaterThan) {
120255
120303
  depth -= 1;
120256
120304
  effects.consume(code);
120257
120305
  if (depth === 0) {
@@ -120335,9 +120383,9 @@ function createTokenize(mode) {
120335
120383
  }
120336
120384
  // Dispatch a non-blank continuation line: fenced code at line start, else body.
120337
120385
  function bodyLineStart(code) {
120338
- if (atLineStart && code === codes.tilde)
120386
+ if (atLineStart && code === codes_codes.tilde)
120339
120387
  return bodyAfterLineStart(code);
120340
- if (atLineStart && code === codes.graveAccent) {
120388
+ if (atLineStart && code === codes_codes.graveAccent) {
120341
120389
  codeSpanOpenSize = 0;
120342
120390
  // Leave `atLineStart` set — `countOpenTicks` needs it to tell a fence from an
120343
120391
  // inline code span once the run of backticks is fully counted; it's cleared once
@@ -120352,7 +120400,7 @@ function createTokenize(mode) {
120352
120400
  // fence) refuses so CommonMark html-flow reparses it exactly as it does today.
120353
120401
  function plainClaimLineStart(code) {
120354
120402
  // Leading whitespace only → treat as a blank line, matching CommonMark.
120355
- if (code === codes.space || code === codes.horizontalTab) {
120403
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
120356
120404
  effects.consume(code);
120357
120405
  return plainClaimLineStart;
120358
120406
  }
@@ -120365,7 +120413,7 @@ function createTokenize(mode) {
120365
120413
  // paragraph that merely starts with a tag must fall back so its markdown
120366
120414
  // parses and rehype-raw re-nests it into the wrapper.
120367
120415
  if (pendingBlankLine) {
120368
- if (code !== codes.lessThan)
120416
+ if (code !== codes_codes.lessThan)
120369
120417
  return nok(code);
120370
120418
  return effects.check(markupOnlyContinuation, plainClaimContinue, nok)(code);
120371
120419
  }
@@ -120418,7 +120466,7 @@ function tokenizeMarkupOnlyContinuation(effects, ok, nok) {
120418
120466
  return afterLessThan;
120419
120467
  }
120420
120468
  function afterLessThan(code) {
120421
- if (code === codes.slash) {
120469
+ if (code === codes_codes.slash) {
120422
120470
  effects.consume(code);
120423
120471
  return afterSlash;
120424
120472
  }
@@ -120437,7 +120485,7 @@ function tokenizeMarkupOnlyContinuation(effects, ok, nok) {
120437
120485
  function scanToLineEnd(code) {
120438
120486
  if (code === null || markdownLineEnding(code)) {
120439
120487
  effects.exit(types_types.data);
120440
- return lastNonSpace === codes.greaterThan ? ok(code) : nok(code);
120488
+ return lastNonSpace === codes_codes.greaterThan ? ok(code) : nok(code);
120441
120489
  }
120442
120490
  if (!markdownSpace(code))
120443
120491
  lastNonSpace = code;
@@ -120470,8 +120518,8 @@ function tokenizeMarkupOnlyContinuation(effects, ok, nok) {
120470
120518
  */
120471
120519
  function syntax_mdxComponent() {
120472
120520
  return {
120473
- flow: { [codes.lessThan]: [mdxComponentFlowConstruct] },
120474
- text: { [codes.lessThan]: [mdxComponentTextConstruct] },
120521
+ flow: { [codes_codes.lessThan]: [mdxComponentFlowConstruct] },
120522
+ text: { [codes_codes.lessThan]: [mdxComponentTextConstruct] },
120475
120523
  };
120476
120524
  }
120477
120525
 
@@ -122931,21 +122979,21 @@ function resolveEntity(name) {
122931
122979
  function tokenizeLooseHtmlEntity(effects, ok, nok) {
122932
122980
  let length = 0;
122933
122981
  const start = (code) => {
122934
- if (code !== codes.ampersand)
122982
+ if (code !== codes_codes.ampersand)
122935
122983
  return nok(code);
122936
122984
  effects.enter('looseHtmlEntity');
122937
122985
  effects.consume(code);
122938
122986
  return afterAmpersand;
122939
122987
  };
122940
122988
  const afterAmpersand = (code) => {
122941
- if (code === codes.numberSign) {
122989
+ if (code === codes_codes.numberSign) {
122942
122990
  effects.consume(code);
122943
122991
  return afterHash;
122944
122992
  }
122945
122993
  return accumulateNamed(code);
122946
122994
  };
122947
122995
  const afterHash = (code) => {
122948
- if (code === codes.lowercaseX || code === codes.uppercaseX) {
122996
+ if (code === codes_codes.lowercaseX || code === codes_codes.uppercaseX) {
122949
122997
  effects.consume(code);
122950
122998
  return accumulateHex;
122951
122999
  }
@@ -122959,7 +123007,7 @@ function tokenizeLooseHtmlEntity(effects, ok, nok) {
122959
123007
  }
122960
123008
  if (length === 0)
122961
123009
  return nok(code);
122962
- if (code === codes.semicolon)
123010
+ if (code === codes_codes.semicolon)
122963
123011
  return nok(code);
122964
123012
  effects.exit('looseHtmlEntity');
122965
123013
  return ok(code);
@@ -122972,7 +123020,7 @@ function tokenizeLooseHtmlEntity(effects, ok, nok) {
122972
123020
  }
122973
123021
  if (length === 0)
122974
123022
  return nok(code);
122975
- if (code === codes.semicolon)
123023
+ if (code === codes_codes.semicolon)
122976
123024
  return nok(code);
122977
123025
  effects.exit('looseHtmlEntity');
122978
123026
  return ok(code);
@@ -122985,7 +123033,7 @@ function tokenizeLooseHtmlEntity(effects, ok, nok) {
122985
123033
  }
122986
123034
  if (length === 0)
122987
123035
  return nok(code);
122988
- if (code === codes.semicolon)
123036
+ if (code === codes_codes.semicolon)
122989
123037
  return nok(code);
122990
123038
  effects.exit('looseHtmlEntity');
122991
123039
  return ok(code);
@@ -123020,7 +123068,7 @@ function exitLooseHtmlEntity(token) {
123020
123068
  }
123021
123069
  function looseHtmlEntity() {
123022
123070
  return {
123023
- text: { [codes.ampersand]: looseHtmlEntityConstruct },
123071
+ text: { [codes_codes.ampersand]: looseHtmlEntityConstruct },
123024
123072
  };
123025
123073
  }
123026
123074
  function looseHtmlEntityFromMarkdown() {
@@ -125377,7 +125425,7 @@ function jsx_table_jsxTableFromMarkdown() {
125377
125425
  function tokenizeJsxComment(effects, ok, nok) {
125378
125426
  return start;
125379
125427
  function start(code) {
125380
- if (code !== codes.leftCurlyBrace)
125428
+ if (code !== codes_codes.leftCurlyBrace)
125381
125429
  return nok(code);
125382
125430
  effects.enter('mdxFlowExpression');
125383
125431
  effects.enter('mdxFlowExpressionMarker');
@@ -125386,7 +125434,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125386
125434
  return expectSlash;
125387
125435
  }
125388
125436
  function expectSlash(code) {
125389
- if (code !== codes.slash) {
125437
+ if (code !== codes_codes.slash) {
125390
125438
  effects.exit('mdxFlowExpression');
125391
125439
  return nok(code);
125392
125440
  }
@@ -125395,7 +125443,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125395
125443
  return expectStar;
125396
125444
  }
125397
125445
  function expectStar(code) {
125398
- if (code !== codes.asterisk) {
125446
+ if (code !== codes_codes.asterisk) {
125399
125447
  effects.exit('mdxFlowExpressionChunk');
125400
125448
  effects.exit('mdxFlowExpression');
125401
125449
  return nok(code);
@@ -125422,7 +125470,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125422
125470
  effects.exit('mdxFlowExpressionChunk');
125423
125471
  return before(code);
125424
125472
  }
125425
- if (code === codes.asterisk) {
125473
+ if (code === codes_codes.asterisk) {
125426
125474
  effects.consume(code);
125427
125475
  return maybeClosed;
125428
125476
  }
@@ -125434,11 +125482,11 @@ function tokenizeJsxComment(effects, ok, nok) {
125434
125482
  effects.exit('mdxFlowExpressionChunk');
125435
125483
  return before(code);
125436
125484
  }
125437
- if (code === codes.slash) {
125485
+ if (code === codes_codes.slash) {
125438
125486
  effects.consume(code);
125439
125487
  return expectClosingBrace;
125440
125488
  }
125441
- if (code === codes.asterisk) {
125489
+ if (code === codes_codes.asterisk) {
125442
125490
  effects.consume(code);
125443
125491
  return maybeClosed;
125444
125492
  }
@@ -125450,7 +125498,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125450
125498
  effects.exit('mdxFlowExpressionChunk');
125451
125499
  return before(code);
125452
125500
  }
125453
- if (code === codes.rightCurlyBrace) {
125501
+ if (code === codes_codes.rightCurlyBrace) {
125454
125502
  effects.exit('mdxFlowExpressionChunk');
125455
125503
  effects.enter('mdxFlowExpressionMarker');
125456
125504
  effects.consume(code);
@@ -125458,7 +125506,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125458
125506
  effects.exit('mdxFlowExpression');
125459
125507
  return ok;
125460
125508
  }
125461
- if (code === codes.asterisk) {
125509
+ if (code === codes_codes.asterisk) {
125462
125510
  effects.consume(code);
125463
125511
  return maybeClosed;
125464
125512
  }
@@ -125469,7 +125517,7 @@ function tokenizeJsxComment(effects, ok, nok) {
125469
125517
  function jsxComment() {
125470
125518
  return {
125471
125519
  flow: {
125472
- [codes.leftCurlyBrace]: {
125520
+ [codes_codes.leftCurlyBrace]: {
125473
125521
  name: 'jsxComment',
125474
125522
  concrete: true,
125475
125523
  tokenize: tokenizeJsxComment,
@@ -125510,7 +125558,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125510
125558
  let codeSpanOpenSize = 0;
125511
125559
  let codeSpanCloseSize = 0;
125512
125560
  let depth = 1;
125513
- const ABLE_SUFFIX = [codes.lowercaseA, codes.lowercaseB, codes.lowercaseL, codes.lowercaseE];
125561
+ const ABLE_SUFFIX = [codes_codes.lowercaseA, codes_codes.lowercaseB, codes_codes.lowercaseL, codes_codes.lowercaseE];
125514
125562
  /** Build a state chain that matches a sequence of character codes. */
125515
125563
  function matchChars(chars, onMatch, onFail) {
125516
125564
  if (chars.length === 0)
@@ -125525,7 +125573,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125525
125573
  }
125526
125574
  return start;
125527
125575
  function start(code) {
125528
- if (code !== codes.lessThan)
125576
+ if (code !== codes_codes.lessThan)
125529
125577
  return nok(code);
125530
125578
  effects.enter('jsxTable');
125531
125579
  effects.enter('jsxTableData');
@@ -125533,14 +125581,14 @@ function tokenizeJsxTable(effects, ok, nok) {
125533
125581
  return afterLessThan;
125534
125582
  }
125535
125583
  function afterLessThan(code) {
125536
- if (code === codes.uppercaseT || code === codes.lowercaseT) {
125584
+ if (code === codes_codes.uppercaseT || code === codes_codes.lowercaseT) {
125537
125585
  effects.consume(code);
125538
125586
  return matchChars(ABLE_SUFFIX, afterTagName, nok);
125539
125587
  }
125540
125588
  return nok(code);
125541
125589
  }
125542
125590
  function afterTagName(code) {
125543
- if (code === codes.greaterThan || code === codes.slash || code === codes.space || code === codes.horizontalTab) {
125591
+ if (code === codes_codes.greaterThan || code === codes_codes.slash || code === codes_codes.space || code === codes_codes.horizontalTab) {
125544
125592
  effects.consume(code);
125545
125593
  return body;
125546
125594
  }
@@ -125556,17 +125604,17 @@ function tokenizeJsxTable(effects, ok, nok) {
125556
125604
  effects.exit('jsxTableData');
125557
125605
  return continuationStart(code);
125558
125606
  }
125559
- if (code === codes.backslash) {
125607
+ if (code === codes_codes.backslash) {
125560
125608
  effects.consume(code);
125561
125609
  return escapedChar;
125562
125610
  }
125563
- if (code === codes.lessThan) {
125611
+ if (code === codes_codes.lessThan) {
125564
125612
  effects.consume(code);
125565
125613
  return closeSlash;
125566
125614
  }
125567
125615
  // Skip over backtick code spans so `</Table>` in inline code isn't
125568
125616
  // treated as the closing tag
125569
- if (code === codes.graveAccent) {
125617
+ if (code === codes_codes.graveAccent) {
125570
125618
  codeSpanOpenSize = 0;
125571
125619
  return countOpenTicks(code);
125572
125620
  }
@@ -125574,7 +125622,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125574
125622
  return body;
125575
125623
  }
125576
125624
  function countOpenTicks(code) {
125577
- if (code === codes.graveAccent) {
125625
+ if (code === codes_codes.graveAccent) {
125578
125626
  codeSpanOpenSize += 1;
125579
125627
  effects.consume(code);
125580
125628
  return countOpenTicks;
@@ -125584,7 +125632,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125584
125632
  function inCodeSpan(code) {
125585
125633
  if (code === null || markdownLineEnding(code))
125586
125634
  return body(code);
125587
- if (code === codes.graveAccent) {
125635
+ if (code === codes_codes.graveAccent) {
125588
125636
  codeSpanCloseSize = 0;
125589
125637
  return countCloseTicks(code);
125590
125638
  }
@@ -125592,7 +125640,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125592
125640
  return inCodeSpan;
125593
125641
  }
125594
125642
  function countCloseTicks(code) {
125595
- if (code === codes.graveAccent) {
125643
+ if (code === codes_codes.graveAccent) {
125596
125644
  codeSpanCloseSize += 1;
125597
125645
  effects.consume(code);
125598
125646
  return countCloseTicks;
@@ -125607,25 +125655,25 @@ function tokenizeJsxTable(effects, ok, nok) {
125607
125655
  return body;
125608
125656
  }
125609
125657
  function closeSlash(code) {
125610
- if (code === codes.slash) {
125658
+ if (code === codes_codes.slash) {
125611
125659
  effects.consume(code);
125612
125660
  return closeTagFirstChar;
125613
125661
  }
125614
- if (code === codes.uppercaseT || code === codes.lowercaseT) {
125662
+ if (code === codes_codes.uppercaseT || code === codes_codes.lowercaseT) {
125615
125663
  effects.consume(code);
125616
125664
  return matchChars(ABLE_SUFFIX, openAfterTagName, body);
125617
125665
  }
125618
125666
  return body(code);
125619
125667
  }
125620
125668
  function closeTagFirstChar(code) {
125621
- if (code === codes.uppercaseT || code === codes.lowercaseT) {
125669
+ if (code === codes_codes.uppercaseT || code === codes_codes.lowercaseT) {
125622
125670
  effects.consume(code);
125623
125671
  return matchChars(ABLE_SUFFIX, closeGt, body);
125624
125672
  }
125625
125673
  return body(code);
125626
125674
  }
125627
125675
  function openAfterTagName(code) {
125628
- if (code === codes.greaterThan || code === codes.slash || code === codes.space || code === codes.horizontalTab) {
125676
+ if (code === codes_codes.greaterThan || code === codes_codes.slash || code === codes_codes.space || code === codes_codes.horizontalTab) {
125629
125677
  depth += 1;
125630
125678
  effects.consume(code);
125631
125679
  return body;
@@ -125633,7 +125681,7 @@ function tokenizeJsxTable(effects, ok, nok) {
125633
125681
  return body(code);
125634
125682
  }
125635
125683
  function closeGt(code) {
125636
- if (code === codes.greaterThan) {
125684
+ if (code === codes_codes.greaterThan) {
125637
125685
  depth -= 1;
125638
125686
  effects.consume(code);
125639
125687
  if (depth === 0) {
@@ -125707,7 +125755,7 @@ function jsx_table_syntax_tokenizeNonLazyContinuationStart(effects, ok, nok) {
125707
125755
  function syntax_jsxTable() {
125708
125756
  return {
125709
125757
  flow: {
125710
- [codes.lessThan]: [jsxTableConstruct],
125758
+ [codes_codes.lessThan]: [jsxTableConstruct],
125711
125759
  },
125712
125760
  };
125713
125761
  }
@@ -125734,7 +125782,7 @@ function tokenizeTextExpression(effects, ok, nok) {
125734
125782
  let depth = 0;
125735
125783
  return start;
125736
125784
  function start(code) {
125737
- if (code !== codes.leftCurlyBrace)
125785
+ if (code !== codes_codes.leftCurlyBrace)
125738
125786
  return nok(code);
125739
125787
  effects.enter('mdxTextExpression');
125740
125788
  effects.enter('mdxTextExpressionMarker');
@@ -125743,7 +125791,7 @@ function tokenizeTextExpression(effects, ok, nok) {
125743
125791
  return before;
125744
125792
  }
125745
125793
  function before(code) {
125746
- if (code === codes.eof) {
125794
+ if (code === codes_codes.eof) {
125747
125795
  effects.exit('mdxTextExpression');
125748
125796
  return nok(code);
125749
125797
  }
@@ -125753,24 +125801,24 @@ function tokenizeTextExpression(effects, ok, nok) {
125753
125801
  effects.exit('lineEnding');
125754
125802
  return before;
125755
125803
  }
125756
- if (code === codes.rightCurlyBrace && depth === 0) {
125804
+ if (code === codes_codes.rightCurlyBrace && depth === 0) {
125757
125805
  return close(code);
125758
125806
  }
125759
125807
  effects.enter('mdxTextExpressionChunk');
125760
125808
  return inside(code);
125761
125809
  }
125762
125810
  function inside(code) {
125763
- if (code === codes.eof || markdownLineEnding(code)) {
125811
+ if (code === codes_codes.eof || markdownLineEnding(code)) {
125764
125812
  effects.exit('mdxTextExpressionChunk');
125765
125813
  return before(code);
125766
125814
  }
125767
- if (code === codes.rightCurlyBrace && depth === 0) {
125815
+ if (code === codes_codes.rightCurlyBrace && depth === 0) {
125768
125816
  effects.exit('mdxTextExpressionChunk');
125769
125817
  return close(code);
125770
125818
  }
125771
- if (code === codes.leftCurlyBrace)
125819
+ if (code === codes_codes.leftCurlyBrace)
125772
125820
  depth += 1;
125773
- else if (code === codes.rightCurlyBrace)
125821
+ else if (code === codes_codes.rightCurlyBrace)
125774
125822
  depth -= 1;
125775
125823
  effects.consume(code);
125776
125824
  return inside;
@@ -125786,7 +125834,7 @@ function tokenizeTextExpression(effects, ok, nok) {
125786
125834
  function mdxExpressionLenient() {
125787
125835
  return {
125788
125836
  text: {
125789
- [codes.leftCurlyBrace]: {
125837
+ [codes_codes.leftCurlyBrace]: {
125790
125838
  name: 'mdxTextExpression',
125791
125839
  tokenize: tokenizeTextExpression,
125792
125840
  },
@@ -126500,6 +126548,332 @@ const mdxishTags_tags = (doc) => {
126500
126548
  };
126501
126549
  /* harmony default export */ const mdxishTags = ((/* unused pure expression or super */ null && (mdxishTags_tags)));
126502
126550
 
126551
+ ;// ./lib/mdast-util/html-block-component/index.ts
126552
+ const html_block_component_contextMap = new WeakMap();
126553
+ function findHtmlBlockComponentToken() {
126554
+ const events = this.tokenStack;
126555
+ for (let i = events.length - 1; i >= 0; i -= 1) {
126556
+ if (events[i][0].type === 'htmlBlockComponent')
126557
+ return events[i][0];
126558
+ }
126559
+ return undefined;
126560
+ }
126561
+ function enterHtmlBlockComponent(token) {
126562
+ html_block_component_contextMap.set(token, { chunks: [], lastEndLine: token.start.line });
126563
+ this.enter({ type: 'html', value: '' }, token);
126564
+ }
126565
+ function exitHtmlBlockComponentData(token) {
126566
+ const componentToken = findHtmlBlockComponentToken.call(this);
126567
+ if (!componentToken)
126568
+ return;
126569
+ const ctx = html_block_component_contextMap.get(componentToken);
126570
+ if (ctx) {
126571
+ const gap = token.start.line - ctx.lastEndLine;
126572
+ if (ctx.chunks.length > 0 && gap > 0) {
126573
+ ctx.chunks.push('\n'.repeat(gap));
126574
+ }
126575
+ ctx.chunks.push(this.sliceSerialize(token));
126576
+ ctx.lastEndLine = token.end.line;
126577
+ }
126578
+ }
126579
+ function exitHtmlBlockComponent(token) {
126580
+ const ctx = html_block_component_contextMap.get(token);
126581
+ const node = this.stack[this.stack.length - 1];
126582
+ if (ctx) {
126583
+ node.value = ctx.chunks.join('');
126584
+ html_block_component_contextMap.delete(token);
126585
+ }
126586
+ this.exit(token);
126587
+ }
126588
+ function html_block_component_htmlBlockComponentFromMarkdown() {
126589
+ return {
126590
+ enter: {
126591
+ htmlBlockComponent: enterHtmlBlockComponent,
126592
+ },
126593
+ exit: {
126594
+ htmlBlockComponentData: exitHtmlBlockComponentData,
126595
+ htmlBlockComponent: exitHtmlBlockComponent,
126596
+ },
126597
+ };
126598
+ }
126599
+
126600
+ ;// ./lib/micromark/html-block-component/syntax.ts
126601
+
126602
+
126603
+ const TAG_SUFFIX = [
126604
+ codes_codes.uppercaseT,
126605
+ codes_codes.uppercaseM,
126606
+ codes_codes.uppercaseL,
126607
+ codes_codes.uppercaseB,
126608
+ codes_codes.lowercaseL,
126609
+ codes_codes.lowercaseO,
126610
+ codes_codes.lowercaseC,
126611
+ codes_codes.lowercaseK,
126612
+ ];
126613
+ // ---------------------------------------------------------------------------
126614
+ // Shared tokenizer factory
126615
+ // ---------------------------------------------------------------------------
126616
+ /**
126617
+ * Creates a tokenize function for `<HTMLBlock>...</HTMLBlock>`.
126618
+ *
126619
+ * - **flow** (block-level): supports multiline content via line continuations,
126620
+ * consumes trailing whitespace after the closing tag.
126621
+ * - **text** (inline): single-line only, exits immediately after the closing tag.
126622
+ */
126623
+ function syntax_createTokenize(mode) {
126624
+ return function tokenize(effects, ok, nok) {
126625
+ let depth = 1;
126626
+ function matchChars(chars, onMatch, onFail) {
126627
+ if (chars.length === 0)
126628
+ return onMatch;
126629
+ const next = (code) => {
126630
+ if (code === chars[0]) {
126631
+ effects.consume(code);
126632
+ return matchChars(chars.slice(1), onMatch, onFail);
126633
+ }
126634
+ return onFail(code);
126635
+ };
126636
+ return next;
126637
+ }
126638
+ function matchTagName(onMatch, onFail) {
126639
+ const next = (code) => {
126640
+ if (code === codes_codes.uppercaseH) {
126641
+ effects.consume(code);
126642
+ return matchChars(TAG_SUFFIX, onMatch, onFail);
126643
+ }
126644
+ return onFail(code);
126645
+ };
126646
+ return next;
126647
+ }
126648
+ return start;
126649
+ function start(code) {
126650
+ if (code !== codes_codes.lessThan)
126651
+ return nok(code);
126652
+ effects.enter('htmlBlockComponent');
126653
+ effects.enter('htmlBlockComponentData');
126654
+ effects.consume(code);
126655
+ return matchTagName(afterTagName, nok);
126656
+ }
126657
+ function afterTagName(code) {
126658
+ if (code === codes_codes.greaterThan) {
126659
+ effects.consume(code);
126660
+ return body;
126661
+ }
126662
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
126663
+ effects.consume(code);
126664
+ return inAttributes;
126665
+ }
126666
+ if (mode === 'flow' && markdownLineEnding(code)) {
126667
+ effects.exit('htmlBlockComponentData');
126668
+ return attributeContinuationStart(code);
126669
+ }
126670
+ if (code === codes_codes.slash) {
126671
+ effects.consume(code);
126672
+ return selfClose;
126673
+ }
126674
+ return nok(code);
126675
+ }
126676
+ function inAttributes(code) {
126677
+ if (code === codes_codes.greaterThan) {
126678
+ effects.consume(code);
126679
+ return body;
126680
+ }
126681
+ if (code === null) {
126682
+ return nok(code);
126683
+ }
126684
+ if (markdownLineEnding(code)) {
126685
+ if (mode === 'text')
126686
+ return nok(code);
126687
+ effects.exit('htmlBlockComponentData');
126688
+ return attributeContinuationStart(code);
126689
+ }
126690
+ effects.consume(code);
126691
+ return inAttributes;
126692
+ }
126693
+ function attributeContinuationStart(code) {
126694
+ return effects.check(html_block_component_syntax_nonLazyContinuationStart, attributeContinuationNonLazy, continuationAfter)(code);
126695
+ }
126696
+ function attributeContinuationNonLazy(code) {
126697
+ effects.enter(types_types.lineEnding);
126698
+ effects.consume(code);
126699
+ effects.exit(types_types.lineEnding);
126700
+ return attributeContinuationBefore;
126701
+ }
126702
+ function attributeContinuationBefore(code) {
126703
+ if (code === null || markdownLineEnding(code)) {
126704
+ return attributeContinuationStart(code);
126705
+ }
126706
+ effects.enter('htmlBlockComponentData');
126707
+ return inAttributes(code);
126708
+ }
126709
+ function selfClose(code) {
126710
+ if (code === codes_codes.greaterThan) {
126711
+ effects.consume(code);
126712
+ return mode === 'flow' ? afterClose : done(code);
126713
+ }
126714
+ return nok(code);
126715
+ }
126716
+ function body(code) {
126717
+ if (code === null)
126718
+ return nok(code);
126719
+ if (markdownLineEnding(code)) {
126720
+ if (mode === 'text') {
126721
+ // Text constructs operate on paragraph content which spans lines
126722
+ effects.consume(code);
126723
+ return body;
126724
+ }
126725
+ effects.exit('htmlBlockComponentData');
126726
+ return continuationStart(code);
126727
+ }
126728
+ if (code === codes_codes.lessThan) {
126729
+ effects.consume(code);
126730
+ return closeSlash;
126731
+ }
126732
+ effects.consume(code);
126733
+ return body;
126734
+ }
126735
+ function closeSlash(code) {
126736
+ if (code === codes_codes.slash) {
126737
+ effects.consume(code);
126738
+ return matchTagName(closeGt, body);
126739
+ }
126740
+ return matchTagName(openAfterTagName, body)(code);
126741
+ }
126742
+ function openAfterTagName(code) {
126743
+ if (code === codes_codes.greaterThan || code === codes_codes.space || code === codes_codes.horizontalTab) {
126744
+ depth += 1;
126745
+ effects.consume(code);
126746
+ return body;
126747
+ }
126748
+ return body(code);
126749
+ }
126750
+ function closeGt(code) {
126751
+ if (code === codes_codes.greaterThan) {
126752
+ depth -= 1;
126753
+ effects.consume(code);
126754
+ if (depth === 0) {
126755
+ return mode === 'flow' ? afterClose : done(code);
126756
+ }
126757
+ return body;
126758
+ }
126759
+ return body(code);
126760
+ }
126761
+ // -- flow-only states ---------------------------------------------------
126762
+ function afterClose(code) {
126763
+ if (code === null || markdownLineEnding(code)) {
126764
+ return done(code);
126765
+ }
126766
+ if (code === codes_codes.space || code === codes_codes.horizontalTab) {
126767
+ effects.consume(code);
126768
+ return afterClose;
126769
+ }
126770
+ // Reject so the block re-parses as a paragraph, deferring to the
126771
+ // text tokenizer which preserves trailing content in the same line.
126772
+ return nok(code);
126773
+ }
126774
+ // -- flow-only: line continuation ---------------------------------------
126775
+ function continuationStart(code) {
126776
+ return effects.check(html_block_component_syntax_nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code);
126777
+ }
126778
+ function continuationStartNonLazy(code) {
126779
+ effects.enter(types_types.lineEnding);
126780
+ effects.consume(code);
126781
+ effects.exit(types_types.lineEnding);
126782
+ return continuationBefore;
126783
+ }
126784
+ function continuationBefore(code) {
126785
+ if (code === null || markdownLineEnding(code)) {
126786
+ return continuationStart(code);
126787
+ }
126788
+ effects.enter('htmlBlockComponentData');
126789
+ return body(code);
126790
+ }
126791
+ function continuationAfter(code) {
126792
+ if (code === null)
126793
+ return nok(code);
126794
+ effects.exit('htmlBlockComponent');
126795
+ return ok(code);
126796
+ }
126797
+ // -- shared exit --------------------------------------------------------
126798
+ function done(_code) {
126799
+ effects.exit('htmlBlockComponentData');
126800
+ effects.exit('htmlBlockComponent');
126801
+ return ok(_code);
126802
+ }
126803
+ };
126804
+ }
126805
+ // ---------------------------------------------------------------------------
126806
+ // Flow construct (block-level)
126807
+ // ---------------------------------------------------------------------------
126808
+ const html_block_component_syntax_nonLazyContinuationStart = {
126809
+ tokenize: html_block_component_syntax_tokenizeNonLazyContinuationStart,
126810
+ partial: true,
126811
+ };
126812
+ function resolveToHtmlBlockComponent(events) {
126813
+ let index = events.length;
126814
+ while (index > 0) {
126815
+ index -= 1;
126816
+ if (events[index][0] === 'enter' && events[index][1].type === 'htmlBlockComponent') {
126817
+ break;
126818
+ }
126819
+ }
126820
+ if (index > 1 && events[index - 2][1].type === types_types.linePrefix) {
126821
+ events[index][1].start = events[index - 2][1].start;
126822
+ events[index + 1][1].start = events[index - 2][1].start;
126823
+ events.splice(index - 2, 2);
126824
+ }
126825
+ return events;
126826
+ }
126827
+ const htmlBlockComponentFlowConstruct = {
126828
+ name: 'htmlBlockComponent',
126829
+ tokenize: syntax_createTokenize('flow'),
126830
+ resolveTo: resolveToHtmlBlockComponent,
126831
+ concrete: true,
126832
+ };
126833
+ function html_block_component_syntax_tokenizeNonLazyContinuationStart(effects, ok, nok) {
126834
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
126835
+ const self = this;
126836
+ return start;
126837
+ function start(code) {
126838
+ if (markdownLineEnding(code)) {
126839
+ effects.enter(types_types.lineEnding);
126840
+ effects.consume(code);
126841
+ effects.exit(types_types.lineEnding);
126842
+ return after;
126843
+ }
126844
+ return nok(code);
126845
+ }
126846
+ function after(code) {
126847
+ if (self.parser.lazy[self.now().line]) {
126848
+ return nok(code);
126849
+ }
126850
+ return ok(code);
126851
+ }
126852
+ }
126853
+ // ---------------------------------------------------------------------------
126854
+ // Text construct (inline)
126855
+ // ---------------------------------------------------------------------------
126856
+ const htmlBlockComponentTextConstruct = {
126857
+ name: 'htmlBlockComponent',
126858
+ tokenize: syntax_createTokenize('text'),
126859
+ };
126860
+ // ---------------------------------------------------------------------------
126861
+ // Extension
126862
+ // ---------------------------------------------------------------------------
126863
+ function syntax_htmlBlockComponent() {
126864
+ return {
126865
+ flow: {
126866
+ [codes.lessThan]: [htmlBlockComponentFlowConstruct],
126867
+ },
126868
+ text: {
126869
+ [codes.lessThan]: [htmlBlockComponentTextConstruct],
126870
+ },
126871
+ };
126872
+ }
126873
+
126874
+ ;// ./lib/micromark/html-block-component/index.ts
126875
+
126876
+
126503
126877
  ;// ./lib/stripComments.ts
126504
126878
 
126505
126879
 
@@ -126514,19 +126888,22 @@ const mdxishTags_tags = (doc) => {
126514
126888
 
126515
126889
 
126516
126890
 
126891
+
126892
+
126517
126893
  /**
126518
126894
  * Removes Markdown and MDX comments.
126519
126895
  */
126520
126896
  async function stripComments(doc, { mdx, mdxish } = {}) {
126521
126897
  const { replaced, blocks } = extractMagicBlocks(doc);
126522
126898
  const processor = unified();
126523
- // we still require these two extensions because:
126899
+ // we still require these extensions because:
126524
126900
  // 1. we can rely on remarkMdx to parse MDXish
126525
126901
  // 2. we need to parse JSX comments into mdxTextExpression nodes so that the transformers can pick them up
126902
+ // 3. we need to claim <HTMLBlock> before htmlFlow intercepts its inner HTML tags
126526
126903
  if (mdxish) {
126527
126904
  processor
126528
- .data('micromarkExtensions', [jsxTable(), mdxExpression({ allowEmpty: true })])
126529
- .data('fromMarkdownExtensions', [jsxTableFromMarkdown(), mdxExpressionFromMarkdown()])
126905
+ .data('micromarkExtensions', [htmlBlockComponent(), jsxTable(), mdxExpression({ allowEmpty: true })])
126906
+ .data('fromMarkdownExtensions', [htmlBlockComponentFromMarkdown(), jsxTableFromMarkdown(), mdxExpressionFromMarkdown()])
126530
126907
  .data('toMarkdownExtensions', [mdxExpressionToMarkdown()]);
126531
126908
  }
126532
126909
  processor