diff --git a/helpers/content.go b/helpers/content.go index 187dd602892..8070bbf0673 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -578,7 +578,7 @@ func getAsciidocContent(ctx *RenderingContext) []byte { var isAsciidoctor bool path := getAsciidocExecPath() if path == "" { - path := getAsciidoctorExecPath() + path = getAsciidoctorExecPath() if path == "" { jww.ERROR.Println("asciidoctor / asciidoc not found in $PATH: Please install.\n", " Leaving AsciiDoc content unrendered.") @@ -588,12 +588,13 @@ func getAsciidocContent(ctx *RenderingContext) []byte { } jww.INFO.Println("Rendering", ctx.DocumentName, "with", path, "...") - cmd := exec.Command(path, "--no-header-footer", "--safe") + args := []string{"--no-header-footer", "--safe"} if isAsciidoctor { // asciidoctor-specific arg to show stack traces on errors - cmd.Args = append(cmd.Args, "--trace") + args = append(args, "--trace") } - cmd.Args = append(cmd.Args, "-") + args = append(args, "-") + cmd := exec.Command(path, args...) cmd.Stdin = bytes.NewReader(cleanContent) var out, cmderr bytes.Buffer cmd.Stdout = &out @@ -692,7 +693,7 @@ func getRstContent(ctx *RenderingContext) []byte { } } - return result[bodyStart+7: bodyEnd] + return result[bodyStart+7 : bodyEnd] } func orgRender(ctx *RenderingContext, c ContentSpec) []byte {