@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.
@@ -9,7 +9,7 @@ interface Options {
9
9
  * Identifies custom MDX components and recursively parses markdown children.
10
10
  * Replaces tagName with PascalCase component name for React component resolution.
11
11
  *
12
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
12
+ * @see .claude/context/MDXish/Processor Overview.md
13
13
  * @param {Options} options - Configuration options
14
14
  * @param {CustomComponents} options.components - Available custom components
15
15
  * @param {Function} options.processMarkdown - Function to process markdown content
@@ -92197,6 +92197,10 @@ const tailwindPrefix = 'readme-tailwind';
92197
92197
 
92198
92198
 
92199
92199
  const TailwindRoot = ({ children, flow }) => {
92200
+ // `styles/gfm.scss` spaces the wrapped block children through this element and
92201
+ // relies on their margins collapsing through it. Keep it a plain block — no
92202
+ // border, padding, or block formatting context (overflow, display: flow-root/
92203
+ // flex/grid) — or the spacing breaks.
92200
92204
  const Tag = flow ? 'div' : 'span';
92201
92205
  return external_react_default().createElement(Tag, { className: tailwindPrefix }, children);
92202
92206
  };
@@ -117862,7 +117866,7 @@ function normalizeProperties(node) {
117862
117866
  * Identifies custom MDX components and recursively parses markdown children.
117863
117867
  * Replaces tagName with PascalCase component name for React component resolution.
117864
117868
  *
117865
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
117869
+ * @see .claude/context/MDXish/Processor Overview.md
117866
117870
  * @param {Options} options - Configuration options
117867
117871
  * @param {CustomComponents} options.components - Available custom components
117868
117872
  * @param {Function} options.processMarkdown - Function to process markdown content
@@ -120360,6 +120364,13 @@ const htmlFlowTagNames = new Set([...htmlRawNames, ...htmlBlockNames]);
120360
120364
  // blank lines between nested JSX siblings don't fragment the block. Excludes table
120361
120365
  // tags (mdxishTables owns their blank lines) and voids (never close).
120362
120366
  const plainBlockClaimTagNames = new Set([...htmlBlockNames].filter(tag => !HTML_TABLE_STRUCTURE_TAGS.has(tag) && !HTML_VOID_ELEMENTS.has(tag)));
120367
+ const foreignContentTags = new Set(FOREIGN_CONTENT_TAGS);
120368
+ // Type-7 lowercase tags (a, span, button, and unknown names): CommonMark ends their
120369
+ // block at a blank line, fragmenting 4+ column children into indented code. Claimable
120370
+ // only in block-wrapper shape (see `blockWrapperOpenerRest`); lookalike openers
120371
+ // (`<https://…>`) never find a closer, so their claim retreats cleanly to CommonMark.
120372
+ // Voids never close and raw/foreign-content bodies have dedicated owners.
120373
+ const isBlockWrapperClaimTagName = (tag) => !htmlFlowTagNames.has(tag) && !HTML_VOID_ELEMENTS.has(tag) && !foreignContentTags.has(tag);
120363
120374
  // Both are 4 columns per CommonMark, but they mean different things: a tab advances
120364
120375
  // to the next multiple of TAB_STOP_WIDTH, and INDENTED_CODE_MIN_COLUMNS is the depth
120365
120376
  // at which a line would fragment into indented code. Named separately so the two
@@ -120424,6 +120435,11 @@ function createTokenize(mode) {
120424
120435
  // `plainClaimLineStart`: after a blank line it may only continue on a tag line.
120425
120436
  let isPlainBlockClaim = false;
120426
120437
  let pendingBlankLine = false;
120438
+ // Type-7 tag claimed pending the block-wrapper (opener alone on its line) check.
120439
+ let pendingBlockWrapperClaim = false;
120440
+ // True once a block-wrapper claim is confirmed; relaxes the top-of-body island gate
120441
+ // below (type-7 fallback is the fragmentation bug, not intentional indented code).
120442
+ let isBlockWrapperClaim = false;
120427
120443
  // Leading indent columns of the current plain-claim line, reset per line; ≥4 is
120428
120444
  // where CommonMark would fragment the island as indented code. Tabs advance to the
120429
120445
  // next 4-column stop — the same rule `expandIndentToColumns`
@@ -120669,16 +120685,11 @@ function createTokenize(mode) {
120669
120685
  }
120670
120686
  // End of opening tag
120671
120687
  if (code === codes.greaterThan) {
120672
- if (requiresBraceAttr && !sawBraceAttr) {
120673
- // Plain lowercase block tags stay claimable in flow, gated per line by
120674
- // `plainClaimLineStart`; everything else falls through to CommonMark.
120675
- if (!isFlow || !plainBlockClaimTagNames.has(tagName))
120676
- return nok(code);
120677
- isPlainBlockClaim = true;
120678
- }
120688
+ if (requiresBraceAttr && !sawBraceAttr && !claimBraceLessTag())
120689
+ return nok(code);
120679
120690
  effects.consume(code);
120680
120691
  onOpenerLine = isFlow;
120681
- return body;
120692
+ return pendingBlockWrapperClaim ? blockWrapperOpenerRest : body;
120682
120693
  }
120683
120694
  // Quoted attribute value
120684
120695
  if (code === codes.quotationMark || code === codes.apostrophe) {
@@ -120733,6 +120744,35 @@ function createTokenize(mode) {
120733
120744
  // `/ ` without `>` is just part of the attribute area
120734
120745
  return afterOpenTagName(code);
120735
120746
  }
120747
+ // Whether a brace-less lowercase flow tag is claimable: type-6 tags immediately,
120748
+ // type-7 tags pending the block-wrapper check; anything else is CommonMark's.
120749
+ function claimBraceLessTag() {
120750
+ if (!isFlow)
120751
+ return false;
120752
+ if (plainBlockClaimTagNames.has(tagName)) {
120753
+ isPlainBlockClaim = true;
120754
+ return true;
120755
+ }
120756
+ if (isBlockWrapperClaimTagName(tagName)) {
120757
+ pendingBlockWrapperClaim = true;
120758
+ return true;
120759
+ }
120760
+ return false;
120761
+ }
120762
+ // A type-7 tag is claimed only as a block wrapper: opener alone on its line
120763
+ // (trailing spaces ok). Inline content after the opener bails to CommonMark.
120764
+ function blockWrapperOpenerRest(code) {
120765
+ if (markdownSpace(code)) {
120766
+ effects.consume(code);
120767
+ return blockWrapperOpenerRest;
120768
+ }
120769
+ if (!markdownLineEnding(code))
120770
+ return nok(code);
120771
+ pendingBlockWrapperClaim = false;
120772
+ isPlainBlockClaim = true;
120773
+ isBlockWrapperClaim = true;
120774
+ return body(code);
120775
+ }
120736
120776
  // Continuation for multi-line opening tags
120737
120777
  function openTagContinuationStart(code) {
120738
120778
  return effects.check(continuation_checks_nonLazyContinuationStart, openTagContinuationNonLazy, continuationAfter)(code);
@@ -121128,10 +121168,16 @@ function createTokenize(mode) {
121128
121168
  // continue on a tag line (`<…`); any markdown island (`**bold**`, `[block:…]`, a
121129
121169
  // fence) refuses so CommonMark html-flow reparses it exactly as it does today.
121130
121170
  function plainClaimLineStart(code) {
121131
- // Leading whitespace only → treat as a blank line, matching CommonMark.
121132
- if (code === codes.space || code === codes.horizontalTab) {
121133
- plainClaimIndentColumns +=
121134
- code === codes.horizontalTab ? TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH) : 1;
121171
+ // Leading whitespace only → treat as a blank line, matching CommonMark. A tab
121172
+ // advances to the next stop; its trailing `virtualSpace` fillers add nothing
121173
+ // but must still be consumed or they'd read as line content below.
121174
+ if (markdownSpace(code)) {
121175
+ if (code === codes.horizontalTab) {
121176
+ plainClaimIndentColumns += TAB_STOP_WIDTH - (plainClaimIndentColumns % TAB_STOP_WIDTH);
121177
+ }
121178
+ else if (code === codes.space) {
121179
+ plainClaimIndentColumns += 1;
121180
+ }
121135
121181
  effects.consume(code);
121136
121182
  return plainClaimLineStart;
121137
121183
  }
@@ -121143,10 +121189,11 @@ function createTokenize(mode) {
121143
121189
  if (pendingBlankLine) {
121144
121190
  // A 4+ col island nested under other tags is cosmetic nesting indent, not code:
121145
121191
  // keep claiming so promotion dedents + re-parses it as markdown (RM-17560).
121146
- // Tags whose bodies stay raw are excludeda claimed island there would never
121147
- // be re-parsed and would leak as literal text.
121192
+ // Block-wrapper claims extend this to top-of-body islandstheir CommonMark
121193
+ // fallback is the fragmentation bug, not intentional indented code. Tags whose
121194
+ // bodies stay raw are excluded: a claimed island there would leak as literal text.
121148
121195
  if (plainClaimIndentColumns >= INDENTED_CODE_MIN_COLUMNS &&
121149
- sawPlainBlockBodyContent &&
121196
+ (sawPlainBlockBodyContent || isBlockWrapperClaim) &&
121150
121197
  !NON_REPARSED_BODY_TAGS.has(tagName)) {
121151
121198
  return plainClaimContinue(code);
121152
121199
  }
@@ -127053,7 +127100,7 @@ function mdxishMdastToMd(mdast) {
127053
127100
  * Processes markdown content with MDX syntax support and returns a HAST.
127054
127101
  * Detects and renders custom component tags from the components hash.
127055
127102
  *
127056
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
127103
+ * @see .claude/context/MDXish/Processor Overview.md
127057
127104
  */
127058
127105
  function mdxish_mdxish(mdContent, opts = {}) {
127059
127106
  const { components: userComponents = {}, safeMode = false, variables } = opts;
@@ -127337,7 +127384,7 @@ function buildRMDXModule(content, headings, tocHast, opts) {
127337
127384
  * @param opts - The options for the render
127338
127385
  * @returns The React component
127339
127386
  *
127340
- * @see {@link https://github.com/readmeio/rmdx/blob/main/docs/mdxish-flow.md}
127387
+ * @see .claude/context/MDXish/Processor Overview.md
127341
127388
  */
127342
127389
  const renderMdxish = (tree, opts = {}) => {
127343
127390
  const { components: userComponents = {}, variables, ...contextOpts } = opts;