summaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorarrtchiu <arrtchiu@gmail.com>2019-03-04 18:27:18 +0800
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-03-04 11:27:18 +0100
commit75904332f3bedcfe656856821d4c9560a177cc51 (patch)
treeeac01c3d0907659447a8e6424c75ac3c44fa4a4e /helpers
parent60c0eb4e892baedd533424b47baf7039c0005f87 (diff)
Add skipHTML option to blackfriday config
Diffstat (limited to 'helpers')
-rw-r--r--helpers/content.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/helpers/content.go b/helpers/content.go
index f8479cd1b..644942cb1 100644
--- a/helpers/content.go
+++ b/helpers/content.go
@@ -119,6 +119,7 @@ type BlackFriday struct {
PlainIDAnchors bool
Extensions []string
ExtensionsMask []string
+ SkipHTML bool
}
// NewBlackfriday creates a new Blackfriday filled with site config or some sane defaults.
@@ -135,6 +136,7 @@ func newBlackfriday(config map[string]interface{}) *BlackFriday {
"latexDashes": true,
"plainIDAnchors": true,
"taskLists": true,
+ "skipHTML": false,
}
maps.ToLower(defaultParam)
@@ -300,6 +302,10 @@ func (c *ContentSpec) getHTMLRenderer(defaultFlags int, ctx *RenderingContext) b
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
}
+ if ctx.Config.SkipHTML {
+ htmlFlags |= blackfriday.HTML_SKIP_HTML
+ }
+
return &HugoHTMLRenderer{
cs: c,
RenderingContext: ctx,