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:
authorAnthony Fok <foka@debian.org>2015-01-24 23:49:17 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-25 00:06:15 +0300
commitf6c0b472e9f54fa3e0d2695a8cffe343f9112244 (patch)
treed851a1a5d4eed9955850581c9d12b59e93a2d157
parenteb686352b1785844778e1cba8c69b85079e3044f (diff)
Make Blackfriday smart fractions to really default to `true`
Fix my own bug in Pull Request #829, commit eb686352b1785844778e1cba8c69b85079e3044f
-rw-r--r--helpers/content.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/helpers/content.go b/helpers/content.go
index 4f378c82b..3f9cc55d5 100644
--- a/helpers/content.go
+++ b/helpers/content.go
@@ -95,10 +95,11 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
htmlFlags := defaultFlags
htmlFlags |= blackfriday.HTML_USE_XHTML
htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
+ htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
htmlFlags |= blackfriday.HTML_FOOTNOTE_RETURN_LINKS
- var angledQuotes, fractions bool
+ var angledQuotes bool
if m, ok := ctx.ConfigFlags["angledQuotes"]; ok {
angledQuotes = m
@@ -108,12 +109,8 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
htmlFlags |= blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES
}
- if m, ok := ctx.ConfigFlags["fractions"]; ok {
- fractions = m
- }
-
- if fractions {
- htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
+ if m, ok := ctx.ConfigFlags["fractions"]; ok && !m {
+ htmlFlags &^= blackfriday.HTML_SMARTYPANTS_FRACTIONS
}
return blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters)