mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Make Blackfriday smart fractions to really default to true
Fix my own bug in Pull Request #829,
commit eb686352b1
This commit is contained in:
parent
eb686352b1
commit
f6c0b472e9
1 changed files with 4 additions and 7 deletions
|
@ -95,10 +95,11 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
|
||||||
htmlFlags := defaultFlags
|
htmlFlags := defaultFlags
|
||||||
htmlFlags |= blackfriday.HTML_USE_XHTML
|
htmlFlags |= blackfriday.HTML_USE_XHTML
|
||||||
htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
|
htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
|
||||||
|
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
||||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||||
htmlFlags |= blackfriday.HTML_FOOTNOTE_RETURN_LINKS
|
htmlFlags |= blackfriday.HTML_FOOTNOTE_RETURN_LINKS
|
||||||
|
|
||||||
var angledQuotes, fractions bool
|
var angledQuotes bool
|
||||||
|
|
||||||
if m, ok := ctx.ConfigFlags["angledQuotes"]; ok {
|
if m, ok := ctx.ConfigFlags["angledQuotes"]; ok {
|
||||||
angledQuotes = m
|
angledQuotes = m
|
||||||
|
@ -108,12 +109,8 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
|
||||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES
|
htmlFlags |= blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES
|
||||||
}
|
}
|
||||||
|
|
||||||
if m, ok := ctx.ConfigFlags["fractions"]; ok {
|
if m, ok := ctx.ConfigFlags["fractions"]; ok && !m {
|
||||||
fractions = m
|
htmlFlags &^= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
||||||
}
|
|
||||||
|
|
||||||
if fractions {
|
|
||||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters)
|
return blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters)
|
||||||
|
|
Loading…
Reference in a new issue