summaryrefslogtreecommitdiffstats
path: root/markup/highlight
diff options
context:
space:
mode:
Diffstat (limited to 'markup/highlight')
-rw-r--r--markup/highlight/highlight.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go
index 6013ba1c8..156007d0a 100644
--- a/markup/highlight/highlight.go
+++ b/markup/highlight/highlight.go
@@ -25,6 +25,7 @@ import (
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
"github.com/gohugoio/hugo/common/hugio"
+ "github.com/gohugoio/hugo/common/text"
"github.com/gohugoio/hugo/identity"
"github.com/gohugoio/hugo/markup/converter/hooks"
"github.com/gohugoio/hugo/markup/internal/attributes"
@@ -123,7 +124,9 @@ func (h chromaHighlighter) RenderCodeblock(w hugio.FlexiWriter, ctx hooks.Codebl
return err
}
- return highlight(w, ctx.Code(), ctx.Lang(), attributes, cfg)
+ code := text.Puts(ctx.Code())
+
+ return highlight(w, code, ctx.Lang(), attributes, cfg)
}
var id = identity.NewPathIdentity("chroma", "highlight")