radiant-docs 0.1.12 → 0.1.14
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/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import path from "path";
|
|
|
9
9
|
import { getConfig, validateMdxContent } from "./src/lib/validation";
|
|
10
10
|
import remarkCodeBlockComponent from "./src/lib/mdx/remark-code-block-component";
|
|
11
11
|
import remarkDemoteH1 from "./src/lib/mdx/remark-demote-h1";
|
|
12
|
+
import remarkGfm from "remark-gfm";
|
|
12
13
|
import rehypeSlug from "rehype-slug";
|
|
13
14
|
import rehypeAutolinkHeadings from "rehype-autolink-headings";
|
|
14
15
|
|
|
@@ -266,7 +267,7 @@ export default defineConfig({
|
|
|
266
267
|
},
|
|
267
268
|
integrations: [
|
|
268
269
|
mdx({
|
|
269
|
-
remarkPlugins: [remarkDemoteH1, remarkCodeBlockComponent],
|
|
270
|
+
remarkPlugins: [remarkGfm, remarkDemoteH1, remarkCodeBlockComponent],
|
|
270
271
|
rehypePlugins: [
|
|
271
272
|
rehypeSlug,
|
|
272
273
|
[
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"@fontsource/google-sans-flex": "^5.2.2",
|
|
18
18
|
"@iconify-json/lucide": "^1.2.79",
|
|
19
19
|
"@iconify-json/simple-icons": "^1.2.69",
|
|
20
|
+
"mdast-util-gfm": "^3.1.0",
|
|
21
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
20
22
|
"@readme/oas-to-snippet": "^29.3.0",
|
|
21
23
|
"@resvg/resvg-js": "^2.6.2",
|
|
22
24
|
"@stoplight/spectral-core": "^1.20.0",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"prismjs": "^1.30.0",
|
|
35
37
|
"rehype-autolink-headings": "^7.1.0",
|
|
36
38
|
"rehype-slug": "^6.0.0",
|
|
39
|
+
"remark-gfm": "^4.0.1",
|
|
37
40
|
"simple-git": "^3.30.0",
|
|
38
41
|
"tailwindcss": "^4.1.17",
|
|
39
42
|
"yaml": "^2.8.2",
|
package/template/package.json
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"@fontsource/google-sans-flex": "^5.2.2",
|
|
22
22
|
"@iconify-json/lucide": "^1.2.79",
|
|
23
23
|
"@iconify-json/simple-icons": "^1.2.69",
|
|
24
|
+
"mdast-util-gfm": "^3.1.0",
|
|
25
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
24
26
|
"@readme/oas-to-snippet": "^29.3.0",
|
|
25
27
|
"@resvg/resvg-js": "^2.6.2",
|
|
26
28
|
"@stoplight/spectral-core": "^1.20.0",
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
"prismjs": "^1.30.0",
|
|
39
41
|
"rehype-autolink-headings": "^7.1.0",
|
|
40
42
|
"rehype-slug": "^6.0.0",
|
|
43
|
+
"remark-gfm": "^4.0.1",
|
|
41
44
|
"simple-git": "^3.30.0",
|
|
42
45
|
"tailwindcss": "^4.1.17",
|
|
43
46
|
"yaml": "^2.8.2",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Root } from "mdast";
|
|
2
2
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
3
|
+
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
3
4
|
import { mdxFromMarkdown } from "mdast-util-mdx";
|
|
5
|
+
import { gfm } from "micromark-extension-gfm";
|
|
4
6
|
import { mdxjs } from "micromark-extension-mdxjs";
|
|
5
7
|
import type { Plugin } from "unified";
|
|
6
8
|
import { visitParents } from "unist-util-visit-parents";
|
|
@@ -192,8 +194,8 @@ function readBooleanAttribute(
|
|
|
192
194
|
|
|
193
195
|
function parseComponentPreviewChildren(rawCode: string): unknown[] {
|
|
194
196
|
const parsedTree = fromMarkdown(rawCode, {
|
|
195
|
-
extensions: [mdxjs()],
|
|
196
|
-
mdastExtensions: [mdxFromMarkdown()],
|
|
197
|
+
extensions: [gfm(), mdxjs()],
|
|
198
|
+
mdastExtensions: [gfmFromMarkdown(), mdxFromMarkdown()],
|
|
197
199
|
}) as Root;
|
|
198
200
|
|
|
199
201
|
const children = Array.isArray(parsedTree.children) ? parsedTree.children : [];
|
|
@@ -1438,7 +1438,8 @@ function validateComponentUsage(content: string): void {
|
|
|
1438
1438
|
.replace(/````[\s\S]*?````/g, "") // 4-backtick code blocks (check first, they're longer)
|
|
1439
1439
|
.replace(/```[\s\S]*?```/g, "") // fenced code blocks
|
|
1440
1440
|
.replace(/`[^`]+`/g, "") // inline code
|
|
1441
|
-
|
|
1441
|
+
// JSX string expressions like {'<Component title="Example" />'} or {"<Component />"}
|
|
1442
|
+
.replace(/\{\s*(['"`])(?:\\.|(?!\1)[\s\S])*?\1\s*\}/g, "");
|
|
1442
1443
|
|
|
1443
1444
|
// Find all JSX component tags (PascalCase tags)
|
|
1444
1445
|
// Matches: <ComponentName, <ComponentName>, <ComponentName />, etc.
|