Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/content.go')
-rw-r--r--helpers/content.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/helpers/content.go b/helpers/content.go
index 86c3f8c5a..8e3fda505 100644
--- a/helpers/content.go
+++ b/helpers/content.go
@@ -40,6 +40,7 @@ var SummaryDivider = []byte("<!--more-->")
// Blackfriday holds configuration values for Blackfriday rendering.
type Blackfriday struct {
+ Smartypants bool
AngledQuotes bool
Fractions bool
HrefTargetBlank bool
@@ -52,6 +53,7 @@ type Blackfriday struct {
// NewBlackfriday creates a new Blackfriday with some sane defaults.
func NewBlackfriday() *Blackfriday {
return &Blackfriday{
+ Smartypants: true,
AngledQuotes: false,
Fractions: true,
HrefTargetBlank: false,
@@ -148,9 +150,12 @@ func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render
htmlFlags := defaultFlags
htmlFlags |= blackfriday.HTML_USE_XHTML
- htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
htmlFlags |= blackfriday.HTML_FOOTNOTE_RETURN_LINKS
+ if ctx.getConfig().Smartypants {
+ htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
+ }
+
if ctx.getConfig().AngledQuotes {
htmlFlags |= blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES
}