@readme/markdown 14.13.1 → 14.13.2

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.js CHANGED
@@ -12645,6 +12645,10 @@ const tailwindPrefix = 'readme-tailwind';
12645
12645
 
12646
12646
 
12647
12647
  const TailwindRoot = ({ children, flow }) => {
12648
+ // `styles/gfm.scss` spaces the wrapped block children through this element and
12649
+ // relies on their margins collapsing through it. Keep it a plain block — no
12650
+ // border, padding, or block formatting context (overflow, display: flow-root/
12651
+ // flex/grid) — or the spacing breaks.
12648
12652
  const Tag = flow ? 'div' : 'span';
12649
12653
  return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement(Tag, { className: tailwindPrefix }, children);
12650
12654
  };
@@ -99107,7 +99111,7 @@ function normalizeProperties(node) {
99107
99111
  * Identifies custom MDX components and recursively parses markdown children.
99108
99112
  * Replaces tagName with PascalCase component name for React component resolution.
99109
99113
  *
99110
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
99114
+ * @see .claude/context/MDXish/Processor Overview.md
99111
99115
  * @param {Options} options - Configuration options
99112
99116
  * @param {CustomComponents} options.components - Available custom components
99113
99117
  * @param {Function} options.processMarkdown - Function to process markdown content
@@ -101605,6 +101609,13 @@ const htmlFlowTagNames = new Set([...htmlRawNames, ...htmlBlockNames]);
101605
101609
  // blank lines between nested JSX siblings don't fragment the block. Excludes table
101606
101610
  // tags (mdxishTables owns their blank lines) and voids (never close).
101607
101611
  const plainBlockClaimTagNames = new Set([...htmlBlockNames].filter(tag => !HTML_TABLE_STRUCTURE_TAGS.has(tag) && !HTML_VOID_ELEMENTS.has(tag)));
101612
+ const foreignContentTags = new Set(FOREIGN_CONTENT_TAGS);
101613
+ // Type-7 lowercase tags (a, span, button, and unknown names): CommonMark ends their
101614
+ // block at a blank line, fragmenting 4+ column children into indented code. Claimable
101615
+ // only in block-wrapper shape (see `blockWrapperOpenerRest`); lookalike openers
101616
+ // (`<https://…>`) never find a closer, so their claim retreats cleanly to CommonMark.
101617
+ // Voids never close and raw/foreign-content bodies have dedicated owners.
101618
+ const isBlockWrapperClaimTagName = (tag) => !htmlFlowTagNames.has(tag) && !HTML_VOID_ELEMENTS.has(tag) && !foreignContentTags.has(tag);
101608
101619
  // Both are 4 columns per CommonMark, but they mean different things: a tab advances
101609
101620
  // to the next multiple of TAB_STOP_WIDTH, and INDENTED_CODE_MIN_COLUMNS is the depth
101610
101621
  // at which a line would fragment into indented code. Named separately so the two
@@ -101669,6 +101680,11 @@ function createTokenize(mode) {
101669
101680
  // `plainClaimLineStart`: after a blank line it may only continue on a tag line.
101670
101681
  let isPlainBlockClaim = false;
101671
101682
  let pendingBlankLine = false;
101683
+ // Type-7 tag claimed pending the block-wrapper (opener alone on its line) check.
101684
+ let pendingBlockWrapperClaim = false;
101685
+ // True once a block-wrapper claim is confirmed; relaxes the top-of-body island gate
101686
+ // below (type-7 fallback is the fragmentation bug, not intentional indented code).
101687
+ let isBlockWrapperClaim = false;
101672
101688
  // Leading indent columns of the current plain-claim line, reset per line; ≥4 is
101673
101689
  // where CommonMark would fragment the island as indented code. Tabs advance to the
101674
101690
  // next 4-column stop — the same rule `expandIndentToColumns`
@@ -101914,16 +101930,11 @@ function createTokenize(mode) {
101914
101930
  }
101915
101931
  // End of opening tag
101916
101932
  if (code === codes.greaterThan) {
101917
- if (requiresBraceAttr && !sawBraceAttr) {
101918
- // Plain lowercase block tags stay claimable in flow, gated per line by
101919
- // `plainClaimLineStart`; everything else falls through to CommonMark.
101920
- if (!isFlow || !plainBlockClaimTagNames.has(tagName))
101921
- return nok(code);
101922
- isPlainBlockClaim = true;
101923
- }
101933
+ if (requiresBraceAttr && !sawBraceAttr && !claimBraceLessTag())
101934
+ return nok(code);
101924
101935
  effects.consume(code);
101925
101936
  onOpenerLine = isFlow;
101926
- return body;
101937
+ return pendingBlockWrapperClaim ? blockWrapperOpenerRest : body;
101927
101938
  }
101928
101939
  // Quoted attribute value
101929
101940
  if (code === codes.quotationMark || code === codes.apostrophe) {
@@ -101978,6 +101989,35 @@ function createTokenize(mode) {
101978
101989
  // `/ ` without `>` is just part of the attribute area
101979
101990
  return afterOpenTagName(code);
101980
101991
  }
101992
+ // Whether a brace-less lowercase flow tag is claimable: type-6 tags immediately,
101993
+ // type-7 tags pending the block-wrapper check; anything else is CommonMark's.
101994
+ function claimBraceLessTag() {
101995
+ if (!isFlow)
101996
+ return false;
101997
+ if (plainBlockClaimTagNames.has(tagName)) {
101998
+ isPlainBlockClaim = true;
101999
+ return true;
102000
+ }
102001
+ if (isBlockWrapperClaimTagName(tagName)) {
102002
+ pendingBlockWrapperClaim = true;
102003
+ return true;
102004
+ }
102005
+ return false;
102006
+ }
102007
+ // A type-7 tag is claimed only as a block wrapper: opener alone on its line
102008
+ // (trailing spaces ok). Inline content after the opener bails to CommonMark.
102009
+ function blockWrapperOpenerRest(code) {
102010
+ if (markdownSpace(code)) {
102011
+ effects.consume(code);
102012
+ return blockWrapperOpenerRest;
102013
+ }
102014
+ if (!markdownLineEnding(code))
102015
+ return nok(code);
102016
+ pendingBlockWrapperClaim = false;
102017
+ isPlainBlockClaim = true;
102018
+ isBlockWrapperClaim = true;
102019
+ return body(code);
102020
+ }
101981
102021
  // Continuation for multi-line opening tags
101982
102022
  function openTagContinuationStart(code) {
101983
102023
  return effects.check(continuation_checks_nonLazyContinuationStart, openTagContinuationNonLazy, continuationAfter)(code);
@@ -102373,10 +102413,16 @@ function createTokenize(mode) {
102373
102413
  // continue on a tag line (`<…`); any markdown island (`**bold**`, `[block:…]`, a
102374
102414
  // fence) refuses so CommonMark html-flow reparses it exactly as it does today.
102375
102415
  function plainClaimLineStart(code) {
102376
- // Leading whitespace only → treat as a blank line, matching CommonMark.
102377
- if (code === codes.space || code === codes.horizontalTab) {
102378
- plainClaimIndentColumns +=
102379
- code === codes.horizontalTab ? TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH) : 1;
102416
+ // Leading whitespace only → treat as a blank line, matching CommonMark. A tab
102417
+ // advances to the next stop; its trailing `virtualSpace` fillers add nothing
102418
+ // but must still be consumed or they'd read as line content below.
102419
+ if (markdownSpace(code)) {
102420
+ if (code === codes.horizontalTab) {
102421
+ plainClaimIndentColumns += TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH);
102422
+ }
102423
+ else if (code === codes.space) {
102424
+ plainClaimIndentColumns += 1;
102425
+ }
102380
102426
  effects.consume(code);
102381
102427
  return plainClaimLineStart;
102382
102428
  }
@@ -102388,10 +102434,11 @@ function createTokenize(mode) {
102388
102434
  if (pendingBlankLine) {
102389
102435
  // A 4+ col island nested under other tags is cosmetic nesting indent, not code:
102390
102436
  // keep claiming so promotion dedents + re-parses it as markdown (RM-17560).
102391
- // Tags whose bodies stay raw are excludeda claimed island there would never
102392
- // be re-parsed and would leak as literal text.
102437
+ // Block-wrapper claims extend this to top-of-body islandstheir CommonMark
102438
+ // fallback is the fragmentation bug, not intentional indented code. Tags whose
102439
+ // bodies stay raw are excluded: a claimed island there would leak as literal text.
102393
102440
  if (plainClaimIndentColumns >= INDENTED_CODE_MIN_COLUMNS &&
102394
- sawPlainBlockBodyContent &&
102441
+ (sawPlainBlockBodyContent || isBlockWrapperClaim) &&
102395
102442
  !NON_REPARSED_BODY_TAGS.has(tagName)) {
102396
102443
  return plainClaimContinue(code);
102397
102444
  }
@@ -106880,7 +106927,7 @@ function mdxishMdastToMd(mdast) {
106880
106927
  * Processes markdown content with MDX syntax support and returns a HAST.
106881
106928
  * Detects and renders custom component tags from the components hash.
106882
106929
  *
106883
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
106930
+ * @see .claude/context/MDXish/Processor Overview.md
106884
106931
  */
106885
106932
  function mdxish(mdContent, opts = {}) {
106886
106933
  const { components: userComponents = {}, safeMode = false, variables } = opts;
@@ -107220,7 +107267,7 @@ function buildRMDXModule(content, headings, tocHast, opts) {
107220
107267
  * @param opts - The options for the render
107221
107268
  * @returns The React component
107222
107269
  *
107223
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
107270
+ * @see .claude/context/MDXish/Processor Overview.md
107224
107271
  */
107225
107272
  const renderMdxish = (tree, opts = {}) => {
107226
107273
  const { components: userComponents = {}, variables, ...contextOpts } = opts;
package/dist/main.node.js CHANGED
@@ -25271,6 +25271,10 @@ const tailwindPrefix = 'readme-tailwind';
25271
25271
 
25272
25272
 
25273
25273
  const TailwindRoot = ({ children, flow }) => {
25274
+ // `styles/gfm.scss` spaces the wrapped block children through this element and
25275
+ // relies on their margins collapsing through it. Keep it a plain block — no
25276
+ // border, padding, or block formatting context (overflow, display: flow-root/
25277
+ // flex/grid) — or the spacing breaks.
25274
25278
  const Tag = flow ? 'div' : 'span';
25275
25279
  return external_react_default().createElement(Tag, { className: tailwindPrefix }, children);
25276
25280
  };
@@ -119331,7 +119335,7 @@ function normalizeProperties(node) {
119331
119335
  * Identifies custom MDX components and recursively parses markdown children.
119332
119336
  * Replaces tagName with PascalCase component name for React component resolution.
119333
119337
  *
119334
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
119338
+ * @see .claude/context/MDXish/Processor Overview.md
119335
119339
  * @param {Options} options - Configuration options
119336
119340
  * @param {CustomComponents} options.components - Available custom components
119337
119341
  * @param {Function} options.processMarkdown - Function to process markdown content
@@ -121829,6 +121833,13 @@ const htmlFlowTagNames = new Set([...htmlRawNames, ...htmlBlockNames]);
121829
121833
  // blank lines between nested JSX siblings don't fragment the block. Excludes table
121830
121834
  // tags (mdxishTables owns their blank lines) and voids (never close).
121831
121835
  const plainBlockClaimTagNames = new Set([...htmlBlockNames].filter(tag => !HTML_TABLE_STRUCTURE_TAGS.has(tag) && !HTML_VOID_ELEMENTS.has(tag)));
121836
+ const foreignContentTags = new Set(FOREIGN_CONTENT_TAGS);
121837
+ // Type-7 lowercase tags (a, span, button, and unknown names): CommonMark ends their
121838
+ // block at a blank line, fragmenting 4+ column children into indented code. Claimable
121839
+ // only in block-wrapper shape (see `blockWrapperOpenerRest`); lookalike openers
121840
+ // (`<https://…>`) never find a closer, so their claim retreats cleanly to CommonMark.
121841
+ // Voids never close and raw/foreign-content bodies have dedicated owners.
121842
+ const isBlockWrapperClaimTagName = (tag) => !htmlFlowTagNames.has(tag) && !HTML_VOID_ELEMENTS.has(tag) && !foreignContentTags.has(tag);
121832
121843
  // Both are 4 columns per CommonMark, but they mean different things: a tab advances
121833
121844
  // to the next multiple of TAB_STOP_WIDTH, and INDENTED_CODE_MIN_COLUMNS is the depth
121834
121845
  // at which a line would fragment into indented code. Named separately so the two
@@ -121893,6 +121904,11 @@ function createTokenize(mode) {
121893
121904
  // `plainClaimLineStart`: after a blank line it may only continue on a tag line.
121894
121905
  let isPlainBlockClaim = false;
121895
121906
  let pendingBlankLine = false;
121907
+ // Type-7 tag claimed pending the block-wrapper (opener alone on its line) check.
121908
+ let pendingBlockWrapperClaim = false;
121909
+ // True once a block-wrapper claim is confirmed; relaxes the top-of-body island gate
121910
+ // below (type-7 fallback is the fragmentation bug, not intentional indented code).
121911
+ let isBlockWrapperClaim = false;
121896
121912
  // Leading indent columns of the current plain-claim line, reset per line; ≥4 is
121897
121913
  // where CommonMark would fragment the island as indented code. Tabs advance to the
121898
121914
  // next 4-column stop — the same rule `expandIndentToColumns`
@@ -122138,16 +122154,11 @@ function createTokenize(mode) {
122138
122154
  }
122139
122155
  // End of opening tag
122140
122156
  if (code === codes.greaterThan) {
122141
- if (requiresBraceAttr && !sawBraceAttr) {
122142
- // Plain lowercase block tags stay claimable in flow, gated per line by
122143
- // `plainClaimLineStart`; everything else falls through to CommonMark.
122144
- if (!isFlow || !plainBlockClaimTagNames.has(tagName))
122145
- return nok(code);
122146
- isPlainBlockClaim = true;
122147
- }
122157
+ if (requiresBraceAttr && !sawBraceAttr && !claimBraceLessTag())
122158
+ return nok(code);
122148
122159
  effects.consume(code);
122149
122160
  onOpenerLine = isFlow;
122150
- return body;
122161
+ return pendingBlockWrapperClaim ? blockWrapperOpenerRest : body;
122151
122162
  }
122152
122163
  // Quoted attribute value
122153
122164
  if (code === codes.quotationMark || code === codes.apostrophe) {
@@ -122202,6 +122213,35 @@ function createTokenize(mode) {
122202
122213
  // `/ ` without `>` is just part of the attribute area
122203
122214
  return afterOpenTagName(code);
122204
122215
  }
122216
+ // Whether a brace-less lowercase flow tag is claimable: type-6 tags immediately,
122217
+ // type-7 tags pending the block-wrapper check; anything else is CommonMark's.
122218
+ function claimBraceLessTag() {
122219
+ if (!isFlow)
122220
+ return false;
122221
+ if (plainBlockClaimTagNames.has(tagName)) {
122222
+ isPlainBlockClaim = true;
122223
+ return true;
122224
+ }
122225
+ if (isBlockWrapperClaimTagName(tagName)) {
122226
+ pendingBlockWrapperClaim = true;
122227
+ return true;
122228
+ }
122229
+ return false;
122230
+ }
122231
+ // A type-7 tag is claimed only as a block wrapper: opener alone on its line
122232
+ // (trailing spaces ok). Inline content after the opener bails to CommonMark.
122233
+ function blockWrapperOpenerRest(code) {
122234
+ if (markdownSpace(code)) {
122235
+ effects.consume(code);
122236
+ return blockWrapperOpenerRest;
122237
+ }
122238
+ if (!markdownLineEnding(code))
122239
+ return nok(code);
122240
+ pendingBlockWrapperClaim = false;
122241
+ isPlainBlockClaim = true;
122242
+ isBlockWrapperClaim = true;
122243
+ return body(code);
122244
+ }
122205
122245
  // Continuation for multi-line opening tags
122206
122246
  function openTagContinuationStart(code) {
122207
122247
  return effects.check(continuation_checks_nonLazyContinuationStart, openTagContinuationNonLazy, continuationAfter)(code);
@@ -122597,10 +122637,16 @@ function createTokenize(mode) {
122597
122637
  // continue on a tag line (`<…`); any markdown island (`**bold**`, `[block:…]`, a
122598
122638
  // fence) refuses so CommonMark html-flow reparses it exactly as it does today.
122599
122639
  function plainClaimLineStart(code) {
122600
- // Leading whitespace only → treat as a blank line, matching CommonMark.
122601
- if (code === codes.space || code === codes.horizontalTab) {
122602
- plainClaimIndentColumns +=
122603
- code === codes.horizontalTab ? TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH) : 1;
122640
+ // Leading whitespace only → treat as a blank line, matching CommonMark. A tab
122641
+ // advances to the next stop; its trailing `virtualSpace` fillers add nothing
122642
+ // but must still be consumed or they'd read as line content below.
122643
+ if (markdownSpace(code)) {
122644
+ if (code === codes.horizontalTab) {
122645
+ plainClaimIndentColumns += TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH);
122646
+ }
122647
+ else if (code === codes.space) {
122648
+ plainClaimIndentColumns += 1;
122649
+ }
122604
122650
  effects.consume(code);
122605
122651
  return plainClaimLineStart;
122606
122652
  }
@@ -122612,10 +122658,11 @@ function createTokenize(mode) {
122612
122658
  if (pendingBlankLine) {
122613
122659
  // A 4+ col island nested under other tags is cosmetic nesting indent, not code:
122614
122660
  // keep claiming so promotion dedents + re-parses it as markdown (RM-17560).
122615
- // Tags whose bodies stay raw are excludeda claimed island there would never
122616
- // be re-parsed and would leak as literal text.
122661
+ // Block-wrapper claims extend this to top-of-body islandstheir CommonMark
122662
+ // fallback is the fragmentation bug, not intentional indented code. Tags whose
122663
+ // bodies stay raw are excluded: a claimed island there would leak as literal text.
122617
122664
  if (plainClaimIndentColumns >= INDENTED_CODE_MIN_COLUMNS &&
122618
- sawPlainBlockBodyContent &&
122665
+ (sawPlainBlockBodyContent || isBlockWrapperClaim) &&
122619
122666
  !NON_REPARSED_BODY_TAGS.has(tagName)) {
122620
122667
  return plainClaimContinue(code);
122621
122668
  }
@@ -127104,7 +127151,7 @@ function mdxishMdastToMd(mdast) {
127104
127151
  * Processes markdown content with MDX syntax support and returns a HAST.
127105
127152
  * Detects and renders custom component tags from the components hash.
127106
127153
  *
127107
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
127154
+ * @see .claude/context/MDXish/Processor Overview.md
127108
127155
  */
127109
127156
  function mdxish(mdContent, opts = {}) {
127110
127157
  const { components: userComponents = {}, safeMode = false, variables } = opts;
@@ -127444,7 +127491,7 @@ function buildRMDXModule(content, headings, tocHast, opts) {
127444
127491
  * @param opts - The options for the render
127445
127492
  * @returns The React component
127446
127493
  *
127447
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
127494
+ * @see .claude/context/MDXish/Processor Overview.md
127448
127495
  */
127449
127496
  const renderMdxish = (tree, opts = {}) => {
127450
127497
  const { components: userComponents = {}, variables, ...contextOpts } = opts;