Skip to content

Commit

Permalink
Fix excess newlines in empty specification output
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Mar 17, 2024
1 parent 12220b4 commit f87626b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/specification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const disjunctionFormatter = new Intl.ListFormat("en", {
export function render(variables: Variable<unknown>[]): string {
const app = appName();

return header(app, variables) + "\n\n" + specification(variables);
return variables.length < 1
? header(app, variables)
: header(app, variables) + "\n\n" + specification(variables);
}

function appName(): string {
Expand Down
2 changes: 0 additions & 2 deletions test/fixture/specification/app-env-var.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ The `<custom app name>` app uses **declarative environment variables** powered b
> Try [declaring] some environment variables to see them listed here!
[declaring]: https://github.com/ezzatron/austenite#declarations


2 changes: 0 additions & 2 deletions test/fixture/specification/empty.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ The `<app>` app uses **declarative environment variables** powered by
> Try [declaring] some environment variables to see them listed here!
[declaring]: https://github.com/ezzatron/austenite#declarations


0 comments on commit f87626b

Please sign in to comment.