diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-08-16 15:55:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-11-06 19:09:08 +0100 |
commit | 5f6b6ec68936ebbbf590894c02a1a3ecad30735f (patch) | |
tree | f6c91e225a3f24f51af1bde5cfb5b88515d0665d /hugolib/page.go | |
parent | 366ee4d8da1c2b0c1751e9bf6d54638439735296 (diff) | |
download | hugo-5f6b6ec68936ebbbf590894c02a1a3ecad30735f.tar.gz hugo-5f6b6ec68936ebbbf590894c02a1a3ecad30735f.zip |
Prepare for Goldmark
This commmit prepares for the addition of Goldmark as the new Markdown renderer in Hugo.
This introduces a new `markup` package with some common interfaces and each implementation in its own package.
See #5963
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 306ca7b0f..b0e8c4359 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -23,6 +23,8 @@ import ( "sort" "strings" + "github.com/gohugoio/hugo/markup/converter" + "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/hugofs/files" @@ -65,7 +67,7 @@ var ( type pageContext interface { posOffset(offset int) text.Position wrapError(err error) error - getRenderingConfig() *helpers.BlackFriday + getContentConverter() converter.Converter } // wrapErr adds some context to the given error if possible. @@ -299,13 +301,6 @@ func (p *pageState) Translations() page.Pages { return p.translations } -func (p *pageState) getRenderingConfig() *helpers.BlackFriday { - if p.m.renderingConfig == nil { - return p.s.ContentSpec.BlackFriday - } - return p.m.renderingConfig -} - func (ps *pageState) initCommonProviders(pp pagePaths) error { if ps.IsPage() { ps.posNextPrev = &nextPrev{init: ps.s.init.prevNext} @@ -516,6 +511,10 @@ func (p *pageState) wrapError(err error) error { return err } +func (p *pageState) getContentConverter() converter.Converter { + return p.m.contentConverter +} + func (p *pageState) addResources(r ...resource.Resource) { p.resources = append(p.resources, r...) } |