@readme/markdown 13.1.1 → 13.1.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.
@@ -0,0 +1,10 @@
1
+ /** Matches HTML tags (open, close, self-closing) with optional attributes. */
2
+ export declare const HTML_TAG_RE: RegExp;
3
+ /** Matches an HTML element from its opening tag to the matching closing tag. */
4
+ export declare const HTML_ELEMENT_BLOCK_RE: RegExp;
5
+ /** Matches a newline with surrounding horizontal whitespace. */
6
+ export declare const NEWLINE_WITH_WHITESPACE_RE: RegExp;
7
+ /** Matches a closing block-level tag followed by non-tag text or by a newline then non-blank content. */
8
+ export declare const CLOSE_BLOCK_TAG_BOUNDARY_RE: RegExp;
9
+ /** Tests whether a string contains a complete HTML element (open + close tag). */
10
+ export declare const COMPLETE_HTML_ELEMENT_RE: RegExp;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Preprocessor to terminate HTML flow blocks.
3
+ *
4
+ * In CommonMark, HTML blocks (types 6 and 7) only terminate on a blank line.
5
+ * Without one, any content on the next line is consumed as part of the HTML block
6
+ * and never parsed as its own construct. For example, a `[block:callout]` immediately
7
+ * following `<div><p></p></div>` gets swallowed into the HTML flow token.
8
+ *
9
+ * @link https://spec.commonmark.org/0.29/#html-blocks
10
+ *
11
+ * This preprocessor inserts a blank line after standalone HTML lines when the
12
+ * next line is non-blank, ensuring micromark's HTML flow tokenizer terminates
13
+ * and subsequent content is parsed independently.
14
+ *
15
+ * Only targets non-indented lines with lowercase tag names. Uppercase tags
16
+ * (e.g., `<Table>`, `<MyComponent>`) are JSX custom components and don't
17
+ * trigger CommonMark HTML blocks, so they are left untouched.
18
+ *
19
+ * Lines inside fenced code blocks are skipped entirely.
20
+ */
21
+ export declare function terminateHtmlFlowBlocks(content: string): string;
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": "13.1.1",
5
+ "version": "13.1.2",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -46,6 +46,7 @@
46
46
  "mdast-util-to-markdown": "^2.1.2",
47
47
  "micromark-extension-mdx-expression": "^3.0.1",
48
48
  "micromark-util-character": "^2.1.1",
49
+ "micromark-util-html-tag-name": "^2.0.1",
49
50
  "micromark-util-symbol": "^2.0.1",
50
51
  "path-browserify": "^1.0.1",
51
52
  "postcss": "^8.5.1",
@@ -53,6 +54,7 @@
53
54
  "process": "^0.11.10",
54
55
  "react-html-attributes": "^1.4.6",
55
56
  "react-native-known-styling-properties": "^1.3.0",
57
+ "rehype-parse": "^9.0.1",
56
58
  "rehype-raw": "^7.0.0",
57
59
  "rehype-react": "^6.2.1",
58
60
  "rehype-remark": "^10.0.0",
@@ -60,6 +62,7 @@
60
62
  "rehype-slug": "^6.0.0",
61
63
  "rehype-stringify": "^10.0.1",
62
64
  "remark": "^15.0.1",
65
+ "remark-breaks": "^4.0.0",
63
66
  "remark-frontmatter": "^5.0.0",
64
67
  "remark-gfm": "^4.0.0",
65
68
  "remark-mdx": "^3.0.0",
@@ -70,6 +73,7 @@
70
73
  "unified": "^11.0.4",
71
74
  "unist-util-flatmap": "^1.0.0",
72
75
  "unist-util-visit": "^5.0.0",
76
+ "unist-util-visit-parents": "^6.0.2",
73
77
  "util": "^0.12.5",
74
78
  "xast-util-to-xml": "^4.0.0"
75
79
  },
@@ -158,7 +162,7 @@
158
162
  },
159
163
  {
160
164
  "path": "dist/main.node.js",
161
- "maxSize": "800KB"
165
+ "maxSize": "805KB"
162
166
  }
163
167
  ]
164
168
  },