mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 21:44:13 +00:00
Pass RenderingContext by reference in Mmark
This commit is contained in:
parent
befb54da46
commit
be79c35bda
1 changed files with 3 additions and 3 deletions
|
@ -208,7 +208,7 @@ func GetMmarkHtmlRenderer(defaultFlags int, ctx *RenderingContext) mmark.Rendere
|
|||
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 GetMmarkExtensions(ctx RenderingContext) int {
|
|||
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue