@readme/markdown 15.3.0 → 15.5.0

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,4 +1,4 @@
1
- import type { List, ListItem } from 'mdast';
1
+ import type { ListItem, Parents } from 'mdast';
2
2
  import type { Info, State } from 'mdast-util-to-markdown';
3
3
  /**
4
4
  * List-item serializer intended for checklist items
@@ -8,5 +8,5 @@ import type { Info, State } from 'mdast-util-to-markdown';
8
8
  * with their checkbox intact (for example, `- [ ]`) instead of dropping it
9
9
  * We can add more adjustments if needed
10
10
  */
11
- declare const listItem: (node: ListItem, parent?: List, state?: State, info?: Info) => string;
11
+ declare const listItem: (node: ListItem, parent: Parents | undefined, state: State, info: Info) => string;
12
12
  export default listItem;
@@ -0,0 +1,11 @@
1
+ import type { Parents, Text } from 'mdast';
2
+ import type { Info, State } from 'mdast-util-to-markdown';
3
+ /**
4
+ * Re-escapes a leading block marker (`-`, `+`, `#`, `>`) at the start of a table cell, or
5
+ * after a `<br />` within one.
6
+ *
7
+ * A cell is serialized mid-line, so the `atBreak` patterns that escape these characters
8
+ * never fire and an author's `| \- one |` round trips to `| - one |` (RM-17203). Cells are
9
+ * serialized as `containerPhrasing(cell, { before: '|' })`, so `|` marks the cell start.
10
+ */
11
+ export declare const escapeCellStartBlockMarker: (serialized: string, node: Text, parent: Parents | undefined, state: State, info: Info) => string;
@@ -1,4 +1,5 @@
1
1
  import type { Parents, Text } from 'mdast';
2
2
  import type { Info, State } from 'mdast-util-to-markdown';
3
- declare const text: (node: Text, parent: Parents | undefined, state: State, info: Info) => string;
4
- export default text;
3
+ export declare const text: (node: Text, parent: Parents | undefined, state: State, info: Info) => string;
4
+ declare const mdxishText: (node: Text, parent: Parents | undefined, state: State, info: Info) => string;
5
+ export default mdxishText;
@@ -1,12 +1,18 @@
1
+ import type { CustomComponents, Variables } from '../../../types';
1
2
  import type { Root } from 'mdast';
2
3
  import type { Plugin } from 'unified';
4
+ interface Options {
5
+ components?: CustomComponents;
6
+ variables?: Variables;
7
+ }
3
8
  /**
4
9
  * AST transformer to evaluate MDX expressions.
5
10
  * Replaces mdxFlowExpression and mdxTextExpression nodes with their evaluated values.
6
- * Self-contained expressions resolve directly (e.g. `{1+1}`); expressions that
7
- * reference identifiers can resolve if those identifiers were introduced by an
8
- * earlier `export const/function` (collected onto `file.data.mdxishScope`).
9
- * Anything else falls through to the error branch and is kept as literal `{...}` text.
11
+ * Self-contained expressions resolve directly (e.g. `{1+1}`); expressions that reference
12
+ * identifiers can resolve if those identifiers are a custom component, the `user` variables
13
+ * object, or were introduced by an earlier `export const/function` (collected onto
14
+ * `file.data.mdxishScope`). Anything else falls through to the error branch and is kept as
15
+ * literal `{...}` text.
10
16
  */
11
- declare const evaluateExpressions: Plugin<[], Root>;
17
+ declare const evaluateExpressions: Plugin<[Options?], Root>;
12
18
  export default evaluateExpressions;