diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-07-10 12:28:34 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-07-10 12:28:34 +0200 |
commit | ed5ad12af372f8d0856f5648c797efc082b05dc3 (patch) | |
tree | 8d428ec78b98a860395833d65a4b6205e07a6feb | |
parent | 1d7f4413f55073b9ea9a9fc9dd4f1792915fe8e1 (diff) |
Remove []byte to string to []byte conversion in Asciidoc
-rw-r--r-- | helpers/content.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helpers/content.go b/helpers/content.go index 204a56104..5b78832c3 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -367,7 +367,7 @@ func RenderBytes(ctx *RenderingContext) []byte { case "markdown": return markdownRender(ctx) case "asciidoc": - return []byte(getAsciidocContent(ctx.Content)) + return getAsciidocContent(ctx.Content) case "mmark": return mmarkRender(ctx) case "rst": @@ -460,14 +460,14 @@ func HasAsciidoc() bool { // getAsciidocContent calls asciidoctor or asciidoc as an external helper // to convert AsciiDoc content to HTML. -func getAsciidocContent(content []byte) string { +func getAsciidocContent(content []byte) []byte { cleanContent := bytes.Replace(content, SummaryDivider, []byte(""), 1) path := getAsciidocExecPath() if path == "" { jww.ERROR.Println("asciidoctor / asciidoc not found in $PATH: Please install.\n", " Leaving AsciiDoc content unrendered.") - return (string(content)) + return content } jww.INFO.Println("Rendering with", path, "...") @@ -479,7 +479,7 @@ func getAsciidocContent(content []byte) string { jww.ERROR.Println(err) } - return out.String() + return out.Bytes() } // HasRst returns whether rst2html is installed on this computer. |