diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-11-26 10:32:49 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-11-26 22:41:54 +0300 |
commit | e442cf30a215e33b49ce588a9098147282bd883f (patch) | |
tree | 2571d16dd2bb8baa28fb9ededbc527b4d6fa18ce /markup/goldmark | |
parent | 7e223b3baaef68d6e6f99e28f162362c81deffba (diff) |
Fix server rebuild issue with partials referenced from render hooks
Fixes #7990
Diffstat (limited to 'markup/goldmark')
-rw-r--r-- | markup/goldmark/convert.go | 4 | ||||
-rw-r--r-- | markup/goldmark/render_hooks.go | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/markup/goldmark/convert.go b/markup/goldmark/convert.go index ffe9cd45a..2a66cc184 100644 --- a/markup/goldmark/convert.go +++ b/markup/goldmark/convert.go @@ -202,7 +202,7 @@ type renderContext struct { type renderContextData interface { RenderContext() converter.RenderContext DocumentContext() converter.DocumentContext - AddIdentity(id identity.Identity) + AddIdentity(id identity.Provider) } type renderContextDataHolder struct { @@ -219,7 +219,7 @@ func (ctx *renderContextDataHolder) DocumentContext() converter.DocumentContext return ctx.dctx } -func (ctx *renderContextDataHolder) AddIdentity(id identity.Identity) { +func (ctx *renderContextDataHolder) AddIdentity(id identity.Provider) { ctx.ids.Add(id) } diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go index aaae68e7f..c541cbba4 100644 --- a/markup/goldmark/render_hooks.go +++ b/markup/goldmark/render_hooks.go @@ -186,7 +186,7 @@ func (r *hookedRenderer) renderImage(w util.BufWriter, source []byte, node ast.N }, ) - ctx.AddIdentity(h.ImageRenderer.GetIdentity()) + ctx.AddIdentity(h.ImageRenderer) return ast.WalkContinue, err @@ -248,7 +248,10 @@ func (r *hookedRenderer) renderLink(w util.BufWriter, source []byte, node ast.No }, ) - ctx.AddIdentity(h.LinkRenderer.GetIdentity()) + // TODO(bep) I have a working branch that fixes these rather confusing identity types, + // but for now it's important that it's not .GetIdentity() that's added here, + // to make sure we search the entire chain on changes. + ctx.AddIdentity(h.LinkRenderer) return ast.WalkContinue, err } @@ -308,7 +311,7 @@ func (r *hookedRenderer) renderHeading(w util.BufWriter, source []byte, node ast }, ) - ctx.AddIdentity(h.HeadingRenderer.GetIdentity()) + ctx.AddIdentity(h.HeadingRenderer) return ast.WalkContinue, err } |