@readme/markdown 11.14.1 → 12.0.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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Extracts text content from a single AST node recursively.
3
+ * Works with both MDAST and HAST-like node structures.
4
+ *
5
+ * Placed this outside of the utils.ts file to avoid circular dependencies.
6
+ *
7
+ * @param node - The node to extract text from (can be MDAST Node or HAST-like structure)
8
+ * @returns The concatenated text content
9
+ */
10
+ export declare const extractText: (node: {
11
+ children?: unknown[];
12
+ type?: string;
13
+ value?: unknown;
14
+ }) => string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Preprocessor to normalize malformed GFM table separator syntax.
3
+ *
4
+ * Fixes the common mistake where the alignment colon is placed after the pipe
5
+ * instead of before the dashes:
6
+ *
7
+ * Invalid: `|: ---` or `|:---` (colon after pipe)
8
+ * Valid: `| :---` (colon before dashes)
9
+ *
10
+ * Also handles right alignment:
11
+ * Invalid: `| ---:| ` with space before pipe
12
+ * Valid: `| ---:|` (no space before closing pipe)
13
+ *
14
+ * This runs before remark-parse to ensure the table is recognized as a valid GFM table.
15
+ */
16
+ /**
17
+ * Preprocesses markdown content to normalize malformed table separator syntax.
18
+ *
19
+ * @param content - The raw markdown content
20
+ * @returns The content with normalized table separators
21
+ */
22
+ export declare function normalizeTableSeparator(content: string): string;
23
+ export default normalizeTableSeparator;
@@ -1,4 +1,5 @@
1
1
  export declare function base64Decode(str: string): string;
2
+ export declare const JSON_VALUE_MARKER = "__MDXISH_JSON__";
2
3
  export declare const HTML_BLOCK_CONTENT_START = "<!--RDMX_HTMLBLOCK:";
3
4
  export declare const HTML_BLOCK_CONTENT_END = ":RDMX_HTMLBLOCK-->";
4
5
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "11.14.1",
5
+ "version": "12.0.0",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -156,7 +156,7 @@
156
156
  },
157
157
  {
158
158
  "path": "dist/main.node.js",
159
- "maxSize": "785KB"
159
+ "maxSize": "790KB"
160
160
  }
161
161
  ]
162
162
  },
@@ -1,9 +0,0 @@
1
- /**
2
- * Detects if content contains HTML, magic blocks, or MDX syntax.
3
- *
4
- * We can use this in some pipelines to determine if we should have to parse content through
5
- * `.plain() or if it is already plain text and it should be able to detect everything that would
6
- * be stripped or sanitized by `.plain()`.
7
- *
8
- */
9
- export default function isPlainText(content: string): boolean;