Revert "Use bufferpool in Asciidoc handler"

This reverts commit 068a77151e.

This was hasty. We would need to create a copy to use the pool in this case.
This commit is contained in:
Bjørn Erik Pedersen 2016-07-10 19:42:14 +02:00
parent 7c125ebb7d
commit d44bb4ec05

View file

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