Add blackfriday/ExtensionsMask option.

This commit is contained in:
Yosuke INOUE
2015-04-16 10:54:10 +09:00
committed by bep
parent ee5a1bbf44
commit 3596b1b810
2 changed files with 16 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ type Blackfriday struct {
Fractions bool
PlainIDAnchors bool
Extensions []string
ExtensionsMask []string
}
// NewBlackfriday creates a new Blackfriday with some sane defaults.
@@ -154,6 +155,11 @@ func getMarkdownExtensions(ctx *RenderingContext) int {
flags |= flag
}
}
for _, extension := range ctx.getConfig().ExtensionsMask {
if flag, ok := blackfridayExtensionMap[extension]; ok {
flags &= ^flag
}
}
return flags
}