create-zudo-doc 2.3.0 → 2.4.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/dist/scaffold.d.ts +1 -1
- package/dist/scaffold.js +2 -2
- package/package.json +1 -1
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +8 -0
- package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +6 -2
package/dist/scaffold.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export { getSecondaryLang };
|
|
|
11
11
|
*
|
|
12
12
|
* Bumped in lockstep by scripts/release-create-zudo-doc.sh.
|
|
13
13
|
*/
|
|
14
|
-
export declare const ZUDO_DOC_PIN = "^2.
|
|
14
|
+
export declare const ZUDO_DOC_PIN = "^2.4.0";
|
|
15
15
|
export declare function scaffold(choices: UserChoices): Promise<void>;
|
package/dist/scaffold.js
CHANGED
|
@@ -18,7 +18,7 @@ export { getSecondaryLang };
|
|
|
18
18
|
*
|
|
19
19
|
* Bumped in lockstep by scripts/release-create-zudo-doc.sh.
|
|
20
20
|
*/
|
|
21
|
-
export const ZUDO_DOC_PIN = "^2.
|
|
21
|
+
export const ZUDO_DOC_PIN = "^2.4.0";
|
|
22
22
|
/**
|
|
23
23
|
* Files in `templates/base/**` that must never be copied into a generated
|
|
24
24
|
* project. Each entry is matched against the path relative to `templates/base/`
|
|
@@ -580,7 +580,7 @@ function generatePackageJson(choices) {
|
|
|
580
580
|
// @takazudo/zudo-doc/integrations/doc-history which in turn imports
|
|
581
581
|
// @takazudo/zudo-doc-history-server/git-history. Without this dep the
|
|
582
582
|
// plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
|
|
583
|
-
deps["@takazudo/zudo-doc-history-server"] = "^2.
|
|
583
|
+
deps["@takazudo/zudo-doc-history-server"] = "^2.4.0";
|
|
584
584
|
// tsx is no longer needed here: the relocated package plugin imports the
|
|
585
585
|
// runner directly (no `tsx -e` spawn) since the package ships compiled
|
|
586
586
|
// dist/ — package-first migration #2321 (#2337).
|
package/package.json
CHANGED
|
@@ -31,4 +31,12 @@ describe("escapeForMdx", () => {
|
|
|
31
31
|
it("escapes self-closing non-allowlisted component tags", () => {
|
|
32
32
|
expect(escapeForMdx("<Component />")).toMatch(/<Component\s*\/>/);
|
|
33
33
|
});
|
|
34
|
+
|
|
35
|
+
it("escapes the compact self-closing form <Foo/> (no space before slash)", () => {
|
|
36
|
+
// Regression: the opening-tag regex only matches the spaced form <Foo />,
|
|
37
|
+
// so the compact <Foo/> needs the dedicated self-closing branch.
|
|
38
|
+
const out = escapeForMdx("<Foo/>");
|
|
39
|
+
expect(out).toBe("<Foo/>");
|
|
40
|
+
expect(out).not.toContain("<Foo/>");
|
|
41
|
+
});
|
|
34
42
|
});
|
package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts
CHANGED
|
@@ -67,7 +67,11 @@ export function escapeForMdx(content: string): string {
|
|
|
67
67
|
return `</${name}>`;
|
|
68
68
|
},
|
|
69
69
|
)
|
|
70
|
-
// Escape self-closing tags
|
|
70
|
+
// Escape self-closing tags. The spaced form <Foo /> is already handled
|
|
71
|
+
// by the opening-tag regex above ((\s[^>]*)? matches " /", then > closes),
|
|
72
|
+
// but the COMPACT form <Foo/> (no space before the slash) is NOT — the
|
|
73
|
+
// name is consumed, (\s[^>]*)? matches empty, then the regex needs ">"
|
|
74
|
+
// and finds "/". So this branch is still required for the compact form.
|
|
71
75
|
.replace(
|
|
72
76
|
/<([A-Za-z][A-Za-z0-9_-]*)(\s[^>]*)?\s*\/>/g,
|
|
73
77
|
(match, name: string) => {
|
|
@@ -84,7 +88,7 @@ export function escapeForMdx(content: string): string {
|
|
|
84
88
|
// Restore inline code placeholders
|
|
85
89
|
escaped = escaped.replace(
|
|
86
90
|
new RegExp(`${inlinePlaceholder}(\\d+)\x00`, "g"),
|
|
87
|
-
(_, idx: string) => inlineCodes[Number(idx)],
|
|
91
|
+
(_, idx: string) => inlineCodes[Number(idx)] ?? "",
|
|
88
92
|
);
|
|
89
93
|
|
|
90
94
|
return escaped;
|