From 7a8dbea0f73812eab20ba294b39d5eca2e909a33 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 2 Jun 2022 14:47:34 +0200 Subject: [PATCH 1/3] chore: fix html references Signed-off-by: blam --- scripts/api-extractor.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index ae74848af6..34de576c7e 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -40,7 +40,7 @@ import { TSDocTagSyntaxKind, } from '@microsoft/tsdoc'; import { TSDocConfigFile } from '@microsoft/tsdoc-config'; -import { ApiPackage, ApiModel } from '@microsoft/api-extractor-model'; +import { ApiPackage, ApiModel, ApiItem } from '@microsoft/api-extractor-model'; import { IMarkdownDocumenterOptions, MarkdownDocumenter, @@ -939,6 +939,16 @@ async function buildDocs({ this._markdownEmitter = new CustomCustomMarkdownEmitter(newModel); } + private _getFilenameForApiItem(apiItem: ApiItem): string { + const filename: string = super._getFilenameForApiItem(apiItem); + + if (filename.endsWith('.html.md')) { + return `${filename.substring(0, filename.length - 8)}._html.md`; + } + + return filename; + } + // We don't really get many chances to modify the generated AST // so we hook in wherever we can. In this case we add the front matter // just before writing the breadcrumbs at the top. From 77f60d0397c65986502863b9e02de48c91de3f0f Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 2 Jun 2022 15:01:45 +0200 Subject: [PATCH 2/3] chore: fix all occurences of .html. Signed-off-by: blam --- scripts/api-extractor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 34de576c7e..c3b77e4a32 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -942,8 +942,8 @@ async function buildDocs({ private _getFilenameForApiItem(apiItem: ApiItem): string { const filename: string = super._getFilenameForApiItem(apiItem); - if (filename.endsWith('.html.md')) { - return `${filename.substring(0, filename.length - 8)}._html.md`; + if (filename.includes('.html.')) { + return filename.replaceAll('.html.', '._html.'); } return filename; From 1c9a0e478739cd120c438ebf52bc3b8782d10d4d Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 2 Jun 2022 15:13:41 +0200 Subject: [PATCH 3/3] chore: replace all on node14 Signed-off-by: blam --- scripts/api-extractor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index c3b77e4a32..d11a781407 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -943,7 +943,7 @@ async function buildDocs({ const filename: string = super._getFilenameForApiItem(apiItem); if (filename.includes('.html.')) { - return filename.replaceAll('.html.', '._html.'); + return filename.replace(/\.html\./g, '._html.'); } return filename;