From 50203b9804ceeb434226fab8569cefb8937022ab Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 9 Apr 2023 18:40:22 +0200 Subject: [PATCH] fix space for getTree --- internal/epub/core.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/epub/core.go b/internal/epub/core.go index 558ed46..db3864c 100644 --- a/internal/epub/core.go +++ b/internal/epub/core.go @@ -225,6 +225,9 @@ func (e *ePub) getTree(images []*Image, skip_files bool) string { f := fmt.Sprintf("%%%ds- %%s", len(n)*2+2) r = append(r, fmt.Sprintf(f, "", img.Name)) } + if len(r) > 0 { + r = append(r, "") + } return strings.Join(r, "\n") } @@ -242,7 +245,7 @@ func (e *ePub) Write() error { if e.Dry { fmt.Fprintf(os.Stderr, "TOC:\n- %s\n%s\n", e.Title, e.getTree(epubParts[0].Images, true)) if e.DryVerbose { - fmt.Fprintf(os.Stderr, "\nFiles:\n%s\n", e.getTree(epubParts[0].Images, false)) + fmt.Fprintf(os.Stderr, "Files:\n%s\n", e.getTree(epubParts[0].Images, false)) } return nil }