Prevent WARNINGs in RenderString

This commit is contained in:
Bjørn Erik Pedersen 2020-05-24 12:49:45 +02:00
parent 4d7fa9f114
commit 32344fe3db
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -727,11 +727,16 @@ func (p *pageMeta) newContentConverter(ps *pageState, markup string, renderingCo
return converter.NopConverter, errors.Errorf("no content renderer found for markup %q", p.markup) return converter.NopConverter, errors.Errorf("no content renderer found for markup %q", p.markup)
} }
var id string
if !p.f.IsZero() {
id = p.f.UniqueID()
}
cpp, err := cp.New( cpp, err := cp.New(
converter.DocumentContext{ converter.DocumentContext{
Document: newPageForRenderHook(ps), Document: newPageForRenderHook(ps),
DocumentID: p.f.UniqueID(), DocumentID: id,
DocumentName: p.f.Path(), DocumentName: p.Path(),
ConfigOverrides: renderingConfigOverrides, ConfigOverrides: renderingConfigOverrides,
}, },
) )