diff --git a/helpers/content.go b/helpers/content.go index 5b78832c3..47a72ffb9 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -23,6 +23,8 @@ import ( "os/exec" "unicode/utf8" + "github.com/spf13/hugo/bufferpool" + "github.com/miekg/mmark" "github.com/mitchellh/mapstructure" "github.com/russross/blackfriday" @@ -473,8 +475,9 @@ func getAsciidocContent(content []byte) []byte { jww.INFO.Println("Rendering with", path, "...") cmd := exec.Command(path, "--no-header-footer", "--safe", "-") cmd.Stdin = bytes.NewReader(cleanContent) - var out bytes.Buffer - cmd.Stdout = &out + out := bufferpool.GetBuffer() + defer bufferpool.PutBuffer(out) + cmd.Stdout = out if err := cmd.Run(); err != nil { jww.ERROR.Println(err) }