diff options
Diffstat (limited to 'helpers/content.go')
-rw-r--r-- | helpers/content.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/helpers/content.go b/helpers/content.go index d37d9dd28..a327a1e5f 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -41,7 +41,7 @@ var SummaryDivider = []byte("<!--more-->") type Blackfriday struct { AngledQuotes bool Fractions bool - PlainIdAnchors bool + PlainIDAnchors bool Extensions []string } @@ -50,7 +50,7 @@ func NewBlackfriday() *Blackfriday { return &Blackfriday{ AngledQuotes: false, Fractions: true, - PlainIdAnchors: false, + PlainIDAnchors: false, } } @@ -113,17 +113,17 @@ func BytesToHTML(b []byte) template.HTML { } // GetHtmlRenderer creates a new Renderer with the given configuration. -func GetHtmlRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Renderer { +func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Renderer { renderParameters := blackfriday.HtmlRendererParameters{ FootnoteAnchorPrefix: viper.GetString("FootnoteAnchorPrefix"), FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"), } - b := len(ctx.DocumentId) != 0 + b := len(ctx.DocumentID) != 0 - if b && !ctx.getConfig().PlainIdAnchors { - renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix - renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId + if b && !ctx.getConfig().PlainIDAnchors { + renderParameters.FootnoteAnchorPrefix = ctx.DocumentID + ":" + renderParameters.FootnoteAnchorPrefix + renderParameters.HeaderIDSuffix = ":" + ctx.DocumentID } htmlFlags := defaultFlags @@ -158,13 +158,13 @@ func getMarkdownExtensions(ctx *RenderingContext) int { } func markdownRender(ctx *RenderingContext) []byte { - return blackfriday.Markdown(ctx.Content, GetHtmlRenderer(0, ctx), + return blackfriday.Markdown(ctx.Content, GetHTMLRenderer(0, ctx), getMarkdownExtensions(ctx)) } func markdownRenderWithTOC(ctx *RenderingContext) []byte { return blackfriday.Markdown(ctx.Content, - GetHtmlRenderer(blackfriday.HTML_TOC, ctx), + GetHTMLRenderer(blackfriday.HTML_TOC, ctx), getMarkdownExtensions(ctx)) } @@ -209,7 +209,7 @@ func ExtractTOC(content []byte) (newcontent []byte, toc []byte) { type RenderingContext struct { Content []byte PageFmt string - DocumentId string + DocumentID string Config *Blackfriday configInit sync.Once } |