From f0f0106dbbb6aece0a00cd1f1b755eea2dd154a1 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Tue, 9 Jul 2024 21:52:02 -0600 Subject: [PATCH] Add trailing newline to generated doc files Resolves #2632 --- CHANGELOG.md | 3 ++- src/lib/application.ts | 2 +- src/lib/output/themes/default/DefaultTheme.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e16624be..1c3ce3994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ - If a relative linked image is referenced multiple times, TypeDoc will no longer sometimes produce invalid links to the image #2627. - `@link` tags will now be validated in referenced markdown documents, #2629. - `@link` tags are now resolved in project documents, #2629. -- `@hidden` is now properly applied when placed in a function implementation comment. +- HTML/JSON output generated by TypeDoc now contains a trailing newline, #2632. +- `@hidden` is now properly applied when placed in a function implementation comment, #2634. - Comments on re-exports are now rendered. ### Thanks! diff --git a/src/lib/application.ts b/src/lib/application.ts index b5a323e18..7b15a5293 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -614,7 +614,7 @@ export class Application extends ChildableComponent< const ser = this.serializer.projectToObject(project, process.cwd()); const space = this.options.getValue("pretty") ? "\t" : ""; - await writeFile(out, JSON.stringify(ser, null, space)); + await writeFile(out, JSON.stringify(ser, null, space) + "\n"); this.logger.info(this.i18n.json_written_to_0(nicePath(out))); this.logger.verbose(`JSON rendering took ${Date.now() - start}ms`); } diff --git a/src/lib/output/themes/default/DefaultTheme.tsx b/src/lib/output/themes/default/DefaultTheme.tsx index 999ab29ed..f36410116 100644 --- a/src/lib/output/themes/default/DefaultTheme.tsx +++ b/src/lib/output/themes/default/DefaultTheme.tsx @@ -291,7 +291,7 @@ export class DefaultTheme extends Theme { render(page: PageEvent, template: RenderTemplate>): string { const templateOutput = this.defaultLayoutTemplate(page, template); - return "" + JSX.renderElement(templateOutput); + return "" + JSX.renderElement(templateOutput) + "\n"; } private _navigationCache: NavigationElement[] | undefined;