Revert "Use bufferpool in Asciidoc handler"
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 10 Jul 2016 17:42:14 +0000 (19:42 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 10 Jul 2016 17:42:14 +0000 (19:42 +0200)
This reverts commit 068a77151e27adb4106e86c407831ad6aa34ad8d.

This was hasty. We would need to create a copy to use the pool in this case.

helpers/content.go

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