Group both options under Blackfriday: documentIDAnchor

This commit is contained in:
Jacob Gillespie
2015-01-05 12:18:34 -06:00
committed by bep
parent b7716948bc
commit 4adf58cce7
2 changed files with 2 additions and 7 deletions

View File

@@ -85,11 +85,8 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"),
}
if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableFootnoteAnchorPrefix") {
if m, ok := ctx.ConfigFlags["documentIDAnchor"]; ok && m && len(ctx.DocumentId) != 0 {
renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix
}
if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableHeaderIDSuffix") {
renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId
}