mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Revert "Use bufferpool in Asciidoc handler"
This reverts commit 068a77151e27adb4106e86c407831ad6aa34ad8d. This was hasty. We would need to create a copy to use the pool in this case.
This commit is contained in:
@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user