Simplify the configuration of HugoHTMLRenderer
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 22 Jul 2016 09:00:52 +0000 (11:00 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 22 Jul 2016 09:00:52 +0000 (11:00 +0200)
helpers/content.go
helpers/content_renderer.go

index d1b3d787d438a242bfc09f7a58a7fe5a13f4c38b..e955b0004c99b0f340fb37157a702ef1b08d6a2f 100644 (file)
@@ -203,9 +203,8 @@ func getHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render
        }
 
        return &HugoHTMLRenderer{
-               FileResolver: ctx.FileResolver,
-               LinkResolver: ctx.LinkResolver,
-               Renderer:     blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters),
+               RenderingContext: ctx,
+               Renderer:         blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters),
        }
 }
 
index 1613d7613ebe6ec8bb449bd6e936d43e0bd63f69..60ed46e7371af90ee8420a819ee923a9cb215f38 100644 (file)
@@ -29,8 +29,7 @@ type FileResolverFunc func(ref string) (string, error)
 // HugoHTMLRenderer wraps a blackfriday.Renderer, typically a blackfriday.Html
 // Enabling Hugo to customise the rendering experience
 type HugoHTMLRenderer struct {
-       FileResolver FileResolverFunc
-       LinkResolver LinkResolverFunc
+       *RenderingContext
        blackfriday.Renderer
 }