@readme/markdown 14.6.0 → 14.7.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.
- package/components/Image/index.tsx +14 -8
- package/components/Image/style.scss +56 -0
- package/dist/lib/constants.d.ts +5 -0
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/main.js +373 -547
- package/dist/main.node.js +371 -545
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/mdxish/mdxish-html-blocks.d.ts +14 -1
- package/dist/processor/transform/mdxish/preprocess-jsx-expressions.d.ts +0 -3
- package/dist/processor/utils.d.ts +4 -2
- package/package.json +2 -2
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { Transform } from 'mdast-util-from-markdown';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Converts every `<HTMLBlock>` shape that survives parsing into the canonical
|
|
4
|
+
* `html-block` MDAST node, reading the body from the tokenizer's template-literal
|
|
5
|
+
* expression. Three shapes occur:
|
|
6
|
+
*
|
|
7
|
+
* 1. JSX element (`mdxJsxFlowElement`/`mdxJsxTextElement`) — multiline/block
|
|
8
|
+
* context and table cells (after their remarkMdx re-parse).
|
|
9
|
+
* 2. Raw `html` blob (`splitRawHtmlBlocks`) — single-line top-level, or nested
|
|
10
|
+
* in raw HTML like an inline `<div>`.
|
|
11
|
+
* 3. Inline-in-paragraph — split into `html` + expression + `html` siblings.
|
|
12
|
+
*
|
|
13
|
+
* Runs *after* `mdxishTables` so table cells are re-parsed first;
|
|
14
|
+
* `mdxishTables` recognizes the still-JSX `<HTMLBlock>` element when deciding to
|
|
15
|
+
* keep a table as a JSX `<Table>`. This replaces the old base64-comment marker
|
|
16
|
+
* machinery — the #1455 tokenizer hands the body over already parsed.
|
|
4
17
|
*/
|
|
5
18
|
declare const mdxishHtmlBlocks: () => Transform;
|
|
6
19
|
export default mdxishHtmlBlocks;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare function base64Decode(str: string): string;
|
|
2
|
-
export declare const HTML_BLOCK_CONTENT_START = "<!--RDMX_HTMLBLOCK:";
|
|
3
|
-
export declare const HTML_BLOCK_CONTENT_END = ":RDMX_HTMLBLOCK-->";
|
|
4
1
|
/**
|
|
5
2
|
* Removes JSX-style comments (e.g., { /* comment *\/ }) from content.
|
|
6
3
|
*
|
|
@@ -93,10 +93,12 @@ export declare const isMDXEsm: (node: Node) => node is MdxjsEsm;
|
|
|
93
93
|
* Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
|
|
94
94
|
* and unindents the HTML.
|
|
95
95
|
*
|
|
96
|
-
* @param {string} html - HTML
|
|
96
|
+
* @param {string} html - cooked HTML payload (callers strip any template-literal backticks first)
|
|
97
|
+
* @param {number} [openingTagIndent=0] - column the `<HTMLBlock>` opening tag sits at, used to
|
|
98
|
+
* dedent each content line so its indentation reads relative to the tag, not the line start
|
|
97
99
|
* @returns {string} processed HTML
|
|
98
100
|
*/
|
|
99
|
-
export declare function formatHtmlForMdxish(html: string): string;
|
|
101
|
+
export declare function formatHtmlForMdxish(html: string, openingTagIndent?: number): string;
|
|
100
102
|
/**
|
|
101
103
|
* Takes an HTML string and formats it for display in the editor. Removes leading/trailing newlines
|
|
102
104
|
* and unindents the HTML.
|
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": "14.
|
|
5
|
+
"version": "14.7.0",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"path": "dist/main.node.js",
|
|
180
|
-
"maxSize": "
|
|
180
|
+
"maxSize": "950KB"
|
|
181
181
|
}
|
|
182
182
|
]
|
|
183
183
|
},
|