@zudojs/docs 1.0.2 → 1.0.4
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Markdown output generation for documentation documents.
|
|
3
3
|
*/
|
|
4
4
|
import { formatScalar } from "../frontmatter/frontmatter.serializer.js";
|
|
5
|
+
import { escapeHtmlText } from "../utils/utils.href.js";
|
|
5
6
|
import { nodesToMarkdown } from "./generatorMarkdownNodes.js";
|
|
6
7
|
/**
|
|
7
8
|
* Generates a markdown string from a document.
|
|
@@ -51,7 +52,7 @@ export function generateMarkdown(document, options = {}) {
|
|
|
51
52
|
if (document.deprecatedMessage) {
|
|
52
53
|
lines.push(">");
|
|
53
54
|
for (const line of document.deprecatedMessage.split(/\r?\n/)) {
|
|
54
|
-
lines.push(`> ${line}`);
|
|
55
|
+
lines.push(`> ${escapeHtmlText(line)}`);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
lines.push("");
|
|
@@ -84,8 +85,12 @@ function contentToMarkdown(content, sanitizer) {
|
|
|
84
85
|
return nodesToMarkdown(content.nodes);
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Collapses newlines so a value cannot break out of its line, then HTML-escapes
|
|
90
|
+
* it for the same reason the structured `quote` and `callout` nodes do: the
|
|
91
|
+
* value can come from untrusted document JSON.
|
|
92
|
+
*/
|
|
88
93
|
function escapeInline(value) {
|
|
89
|
-
return value.replace(/\r?\n/g, " ");
|
|
94
|
+
return escapeHtmlText(value.replace(/\r?\n/g, " "));
|
|
90
95
|
}
|
|
91
96
|
//# sourceMappingURL=generatorMarkdown.core.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zudojs/docs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Documentation infrastructure with structured document model, registry, validation, navigation, and generation.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@zudojs/errors": "1.
|
|
14
|
+
"@zudojs/errors": "1.3.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"typescript": "7.0.2",
|
|
18
|
-
"vitest": "^
|
|
18
|
+
"vitest": "^5.0.1"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"author": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"documentation",
|
|
43
43
|
"markdown"
|
|
44
44
|
],
|
|
45
|
-
"homepage": "https://
|
|
45
|
+
"homepage": "https://zudojs.oyinlola.site/docs/packages-docs",
|
|
46
46
|
"bugs": {
|
|
47
47
|
"url": "https://github.com/oyinlola-tech/zudo/issues"
|
|
48
48
|
},
|