mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Use bufferpool in Asciidoc handler
This commit is contained in:
parent
ed5ad12af3
commit
068a77151e
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue