Skip to content

Commit

Permalink
Add trailing newline to generated doc files
Browse files Browse the repository at this point in the history
Resolves #2632
  • Loading branch information
Gerrit0 committed Jul 10, 2024
1 parent 32fff2b commit f0f0106
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion src/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/output/themes/default/DefaultTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class DefaultTheme extends Theme {

render(page: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>): string {
const templateOutput = this.defaultLayoutTemplate(page, template);
return "<!DOCTYPE html>" + JSX.renderElement(templateOutput);
return "<!DOCTYPE html>" + JSX.renderElement(templateOutput) + "\n";
}

private _navigationCache: NavigationElement[] | undefined;
Expand Down

0 comments on commit f0f0106

Please sign in to comment.