mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Add skipHTML option to blackfriday config
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
60c0eb4e89
commit
75904332f3
@@ -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,
|
||||
|
Reference in New Issue
Block a user