Skip to content

Commit c064254

Browse files
authored
Add blank parameter description protection to postprocessor (#370)
1 parent 9534fbf commit c064254

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

generate-docs/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"dependencies": {
55
"@microsoft/api-extractor": "^7.47.0",
66
"@microsoft/api-documenter": "^7.25.0",
7-
"reference-coverage-tester": "^0.0.3"
7+
"reference-coverage-tester": "^0.0.5"
88
}
99
}

generate-docs/scripts/package-lock.json

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-docs/scripts/postprocessor.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,18 @@ tryCatch(async () => {
7979
.forEach(interfaceYml => { // contents of docs-ref-autogen/<host>/<host>script
8080
fsx.writeFileSync(
8181
scriptFolder + '/' + interfaceYml,
82-
fsx.readFileSync(scriptFolder + '/' + interfaceYml).toString().replace(/^\s*example: \[\]\s*$/gm, "").replace(/\\\*/gm, "*")
83-
);
82+
fsx.readFileSync(scriptFolder + '/' + interfaceYml).toString()
83+
.replace(/^\s*example: \[\]\s*$/gm, "") // Remove example field from yml as the OPS schema does not support it.
84+
.replace(/description: \\\*[\r\n]/g, "description:") // Remove descriptions that are just "\*".
85+
.replace(/\\\*/gm, "*")); // Fix asterisk protection.
8486
});
8587
} else if (subfilename.indexOf("toc") < 0 && subfilename.indexOf(".yml") > 0) {
8688
fsx.writeFileSync(
8789
hostFolder + '/' + subfilename,
88-
fsx.readFileSync(hostFolder + '/' + subfilename).toString().replace(/^\s*example: \[\]\s*$/gm, "").replace(/\\\*/gm, "*")
89-
);
90+
fsx.readFileSync(hostFolder + '/' + subfilename).toString()
91+
.replace(/^\s*example: \[\]\s*$/gm, "") // Remove example field from yml as the OPS schema does not support it.
92+
.replace(/description: \\\*[\r\n]/g, "description:") // Remove descriptions that are just "\*".
93+
.replace(/\\\*/gm, "*")); // Fix asterisk protection.
9094
}
9195
});
9296
});

0 commit comments

Comments
 (0)