diff --git a/apps/api/src/domain/code-wiki.ts b/apps/api/src/domain/code-wiki.ts index 0b5f840..5911ec0 100644 --- a/apps/api/src/domain/code-wiki.ts +++ b/apps/api/src/domain/code-wiki.ts @@ -99,6 +99,7 @@ export class CodeWiki { private clean(value: string) { return redactSecrets(value) .replace(LINE_NUMBER, '$1') + .replace(/wiki\/modules\/[A-Za-z0-9._/-]+/g, '内部页面') .replace(/\n{3,}/g, '\n\n') .trim() .slice(0, 240 * 1024); @@ -123,7 +124,12 @@ export class CodeWiki { this.read(code, ref, 'package.json'), ]); const material = { - files: (tree.entries ?? []).slice(0, 200).map(entry => entry.path), + // The module map is the platform's internal view of the codebase; a customer page must not + // even name it, or the page becomes a table of contents for pages they cannot open. + files: (tree.entries ?? []) + .map(entry => entry.path) + .filter(path => !path.startsWith('wiki/modules/')) + .slice(0, 200), readme: readme.slice(0, 8000), manifest: manifest.slice(0, 4000), };