@readme/markdown 14.14.0 → 14.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Drop blank lines inside `<svg>`/`<math>` islands: their whitespace is
3
3
  * insignificant XML, but a blank line ends the CommonMark HTML block and spills the
4
- * children out as a code block (#1545). Collapsing keeps the island one block.
4
+ * children out of the island, where parse5 drops the orphaned foreign tags (#1545).
5
+ * Collapsing keeps the island one block.
5
6
  */
6
7
  export declare function collapseForeignContentBlankLines(content: string): string;
@@ -10,6 +10,13 @@ export type MdxAttributes = (MdxJsxAttribute | MdxJsxExpressionAttribute)[];
10
10
  export declare const getInlineMdProcessor: ({ safeMode }?: {
11
11
  safeMode?: boolean;
12
12
  }) => import("unified").Processor<import("mdast").Root, undefined, undefined, undefined, undefined>;
13
+ /**
14
+ * Mark re-parsed subtree roots with the string their positions index into, so consumers
15
+ * slicing by offset use the right source (see `Data.reparseSource`). Only roots are
16
+ * stamped; descendants resolve via their nearest stamped ancestor. Roots a deeper
17
+ * re-parse already stamped keep their own string.
18
+ */
19
+ export declare const stampReparseSource: (roots: Node[], reparseSource: string) => void;
13
20
  /**
14
21
  * True when a tag name starts with an uppercase letter — ReadMe's marker for
15
22
  * a custom MDX component (vs a lowercase HTML tag).
@@ -2,11 +2,10 @@
2
2
  * CommonMark indentation helpers, shared by the mdxish preprocessors so tab- and
3
3
  * space-indented content is measured (and sliced) on one scale.
4
4
  *
5
- * CommonMark's indented-code threshold is 4 *columns*, and a tab is a 4-column tab
6
- * stop — not a fixed 4 characters. Counting characters (tab = 1) under-measures
7
- * tab-indented lines, letting them slip past the 4-column gate so their content
8
- * fragments into code blocks. Keeping one implementation here stops the two callers
9
- * from drifting on what "4 columns" means.
5
+ * CommonMark measures indentation in *columns*, and a tab is a 4-column tab stop — not a
6
+ * fixed 4 characters. Counting characters (tab = 1) under-measures tab-indented lines, so
7
+ * column-anchored decisions (body dedenting, HTML-flow termination) would drift from how
8
+ * micromark reads the same lines.
10
9
  */
11
10
  /** The run of leading spaces/tabs on a line. */
12
11
  export declare const leadingIndent: (line: string) => string;
@@ -3,23 +3,8 @@ import type { Node, Root as MdastRoot, Root } from 'mdast';
3
3
  import type { MdxJsxFlowElement, MdxJsxTextElement, MdxjsEsm } from 'mdast-util-mdx';
4
4
  import type { MdxJsxAttribute } from 'mdast-util-mdx-jsx';
5
5
  import type { Point } from 'unist';
6
- import { Parser } from 'acorn';
7
- /**
8
- * Single instance of acorn parser extended with `acorn-jsx`
9
- * to parse expressions containing JSX.
10
- */
11
- export declare const jsxAcornParser: typeof Parser;
12
- /**
13
- * Disables CommonMark's indented-code-block construct (4+ spaces)
14
- * The micromark tokenizers use follow the CommonMark specification: https://spec.commonmark.org/0.28/#indented-code-blocks
15
- * So any lines indented 4+ spaces are considered as a code block,
16
- * which is unexpected from users that used MDX before.
17
- */
18
- export declare const disableIndentedCode: {
19
- disable: {
20
- null: string[];
21
- };
22
- };
6
+ import { jsxAcornParser } from '../lib/utils/jsx-acorn-parser';
7
+ export { jsxAcornParser };
23
8
  /**
24
9
  * Evaluate a JavaScript expression source and return its value.
25
10
  *