shithub: hugo

Download patch

ref: be79c35bda0154e36d3bc60e8f7bb00d17952e05
parent: befb54da46659e6678fcd2504cbe5c5fbb9e62b8
author: bep <[email protected]>
date: Mon May 25 08:57:37 EDT 2015

Pass RenderingContext by reference in Mmark

--- a/helpers/content.go
+++ b/helpers/content.go
@@ -208,7 +208,7 @@
 	return mmark.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters)
 }
 
-func GetMmarkExtensions(ctx RenderingContext) int {
+func GetMmarkExtensions(ctx *RenderingContext) int {
 	flags := 0
 	flags |= mmark.EXTENSION_TABLES
 	flags |= mmark.EXTENSION_FENCED_CODE
@@ -234,13 +234,13 @@
 
 func MmarkRender(ctx *RenderingContext) []byte {
 	return mmark.Parse(ctx.Content, GetMmarkHtmlRenderer(0, ctx),
-		GetMmarkExtensions(*ctx)).Bytes()
+		GetMmarkExtensions(ctx)).Bytes()
 }
 
 func MmarkRenderWithTOC(ctx *RenderingContext) []byte {
 	return mmark.Parse(ctx.Content,
 		GetMmarkHtmlRenderer(0, ctx),
-		GetMmarkExtensions(*ctx)).Bytes()
+		GetMmarkExtensions(ctx)).Bytes()
 }
 
 // ExtractTOC extracts Table of Contents from content.