Add blackfriday/ExtensionsMask option. - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit 3596b1b81078c1089d6b294a9b35954741d878a9
DIR parent ee5a1bbf44726d062c623d3ed2772d22d562203f
HTML Author: Yosuke INOUE <inoue@kamikakushi.net>
Date: Thu, 16 Apr 2015 10:54:10 +0900
Add blackfriday/ExtensionsMask option.
Diffstat:
M docs/content/overview/configuratio… | 10 ++++++++++
M helpers/content.go | 6 ++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
DIR diff --git a/docs/content/overview/configuration.md b/docs/content/overview/configuration.md
@@ -198,6 +198,16 @@ but only these three.</small></td>
<td class="purpose-title">Purpose:</td>
<td class="purpose-description" colspan="2">Use non-default additional extensions <small>(e.g. Add <code>"hardLineBreak"</code> to use <code>EXTENSION_HARD_LINE_BREAK</code>)</small></td>
</tr>
+
+<tr>
+<td><code>extensionsmask</code></td>
+<td><code>[]</code></td>
+<td><code>EXTENSION_*</code></td>
+</tr>
+<tr>
+<td class="purpose-title">Purpose:</td>
+<td class="purpose-description" colspan="2">Extensions in this option won't be loaded. <small>(e.g. Add <code>"autoHeaderIds"</code> to disable <code>EXTENSION_AUTO_HEADER_IDS</code>)</small></td>
+</tr>
</tbody>
</table>
DIR diff --git a/helpers/content.go b/helpers/content.go
@@ -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
}